Author: jfthomps
Date: Tue Jul 25 17:26:56 2017
New Revision: 1802984

URL: http://svn.apache.org/viewvc?rev=1802984&view=rev
Log:
VCL-1063 - editing a future reservation to have a start time that is in the 
past should not be allowed
VCL-968 - Localization updates for 2.5

requests.php: modified AJsubmitEditRequest: added check for submitted start 
time being in the past

requests.js: modified submitEditReservation: added check for submitted start 
time being in the past

messages.js/template, es_CR/messages.js, es_MX/messages.js, fr_CA/messages.js, 
pt_PT/messages.js: added translation for 'The submitted start time is in the 
past.' - this phrase was specifically chosen because a translation of it 
already exists for php. So, I was able to copy the translated phrases over.

Modified:
    vcl/trunk/web/.ht-inc/requests.php
    vcl/trunk/web/js/nls/es_CR/messages.js
    vcl/trunk/web/js/nls/es_MX/messages.js
    vcl/trunk/web/js/nls/fr_CA/messages.js
    vcl/trunk/web/js/nls/messages.js.template
    vcl/trunk/web/js/nls/pt_PT/messages.js
    vcl/trunk/web/js/requests.js

Modified: vcl/trunk/web/.ht-inc/requests.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/requests.php?rev=1802984&r1=1802983&r2=1802984&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/requests.php (original)
+++ vcl/trunk/web/.ht-inc/requests.php Tue Jul 25 17:26:56 2017
@@ -3601,6 +3601,14 @@ function AJsubmitEditRequest() {
                preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})$/', $day, $tmp);
                $startdt = "{$tmp[1]}-{$tmp[2]}-{$tmp[3]} 
{$matches[1]}:{$matches[4]}:00";
                $startts = datetimeToUnix($startdt) - 
($_SESSION['persistdata']['tzoffset'] * 60);
+               if($startts < time()) {
+                       $cdata = getContinuationVar();
+                       $cont = addContinuationsEntry('AJsubmitEditRequest', 
$cdata, SECINDAY, 1, 0);
+                       sendJSON(array('status' => 'error',
+                                      'errmsg' => i('The submitted start time 
is in the past.'),
+                                      'cont' => $cont));
+                       return;
+               }
        }
        else {
                $startdt = $request['start'];

Modified: vcl/trunk/web/js/nls/es_CR/messages.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/nls/es_CR/messages.js?rev=1802984&r1=1802983&r2=1802984&view=diff
==============================================================================
--- vcl/trunk/web/js/nls/es_CR/messages.js (original)
+++ vcl/trunk/web/js/nls/es_CR/messages.js Tue Jul 25 17:26:56 2017
@@ -23,6 +23,7 @@ nlsmessages = {
 'The end time must be at least 30 minutes in the future.':'La fecha de fin 
debe ser al menos 30 min en el futuro',
 'The end time must be after the start time.':'La fecha de fin debe estar 
después de la fecha de inicio',
 'The end time is too close to the start time.':'La fecha de inicio es 
demasiado cercana a la fecha de fin',
+'The submitted start time is in the past.':'El tiempo de inicio enviado está 
en el pasado.',
 'Times cannot be suggested for cluster reservations':'Tiempos no son sugeridos 
para las reservaciones en grupo',
 'Cancel':'Cancelar',
 'Okay':'Deacuerdo',

Modified: vcl/trunk/web/js/nls/es_MX/messages.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/nls/es_MX/messages.js?rev=1802984&r1=1802983&r2=1802984&view=diff
==============================================================================
--- vcl/trunk/web/js/nls/es_MX/messages.js (original)
+++ vcl/trunk/web/js/nls/es_MX/messages.js Tue Jul 25 17:26:56 2017
@@ -23,6 +23,7 @@ nlsmessages = {
 'The end time must be at least 30 minutes in the future.':'',
 'The end time must be after the start time.':'',
 'The end time is too close to the start time.':'',
+'The submitted start time is in the past.':'El tiempo de inicio enviado está 
en el pasado.',
 'Times cannot be suggested for cluster reservations': 'No se pueden sugerir 
horarios para la reservación de clusters',
 'Cancel': 'Cancelar',
 'Okay': 'Correcto',

Modified: vcl/trunk/web/js/nls/fr_CA/messages.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/nls/fr_CA/messages.js?rev=1802984&r1=1802983&r2=1802984&view=diff
==============================================================================
--- vcl/trunk/web/js/nls/fr_CA/messages.js (original)
+++ vcl/trunk/web/js/nls/fr_CA/messages.js Tue Jul 25 17:26:56 2017
@@ -23,6 +23,7 @@ nlsmessages = {
 'The end time must be at least 30 minutes in the future.':'L\'heure de fin 
doit être d\'au moins 30 minutes à l\'avenir.',
 'The end time must be after the start time.':'L\'heure de fin doit être 
postérieure à l\'heure de début.',
 'The end time is too close to the start time.':'L\'heure de fin est trop 
proche de l\'heure de début.',
+'The submitted start time is in the past.':'L\'heure de début saisie est 
passée',
 'Times cannot be suggested for cluster reservations':'Les temps ne peut pas 
être proposé pour les réservations de munitions',
 'Cancel':'Annuler',
 'Okay':'Bien',

Modified: vcl/trunk/web/js/nls/messages.js.template
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/nls/messages.js.template?rev=1802984&r1=1802983&r2=1802984&view=diff
==============================================================================
--- vcl/trunk/web/js/nls/messages.js.template (original)
+++ vcl/trunk/web/js/nls/messages.js.template Tue Jul 25 17:26:56 2017
@@ -23,6 +23,7 @@ nlsmessages = {
 'The end time must be at least 30 minutes in the future.':'',
 'The end time must be after the start time.':'',
 'The end time is too close to the start time.':'',
+'The submitted start time is in the past.':'',
 'Times cannot be suggested for cluster reservations':'',
 'Cancel':'',
 'Okay':'',

Modified: vcl/trunk/web/js/nls/pt_PT/messages.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/nls/pt_PT/messages.js?rev=1802984&r1=1802983&r2=1802984&view=diff
==============================================================================
--- vcl/trunk/web/js/nls/pt_PT/messages.js (original)
+++ vcl/trunk/web/js/nls/pt_PT/messages.js Tue Jul 25 17:26:56 2017
@@ -23,6 +23,7 @@ nlsmessages = {
 'The end time must be at least 30 minutes in the future.':'O tempo de fim tem 
que ser pelo menos 30 minutos no futuro.',
 'The end time must be after the start time.':'O tempo de fim tem que ser a 
seguir o tempo de inicio.',
 'The end time is too close to the start time.':'O tempo de fim é muito 
próximo do tempo de inicio.',
+'The submitted start time is in the past.':'A data de arranque submetida é no 
passado.',
 'Times cannot be suggested for cluster reservations':'Os tempos não podem ser 
sugeridos pela reserva de cluster',
 'Cancel':'Cancelar',
 'Okay':'OK',

Modified: vcl/trunk/web/js/requests.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/requests.js?rev=1802984&r1=1802983&r2=1802984&view=diff
==============================================================================
--- vcl/trunk/web/js/requests.js (original)
+++ vcl/trunk/web/js/requests.js Tue Jul 25 17:26:56 2017
@@ -1558,6 +1558,11 @@ function submitEditReservation() {
                                                      t.getMinutes());
                var tmp = 
dijit.byId('day').value.match(/([0-9]{4})([0-9]{2})([0-9]{2})/);
                var teststart = new Date(tmp[1], tmp[2] - 1, tmp[3], 
t.getHours(), t.getMinutes(), 0, 0);
+               var now = new Date();
+               if(teststart < now) {
+                       dojo.byId('editResDlgErrMsg').innerHTML = _("The 
submitted start time is in the past.");
+                       return;
+               }
        }
        if(dijit.byId('newnousercheck') && 
dijit.byId('newnousercheck').get('value') == 1)
                data.newnousercheck = 1;


Reply via email to