]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-holiday.php
Mailer project rwritten:
[mailer.git] / inc / modules / member / what-holiday.php
index ec4fae0ba8e477dad99b2e16f48f69f744eccb6e..95e3f651d5b0c615c89c3a84d3b5d444422dc4ab 100644 (file)
@@ -84,12 +84,12 @@ if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) {
        if (empty($content['timestamp'])) $content['timestamp'] = '0';
        if (empty($content['timestamp_ordered'])) $content['timestamp_ordered'] = '0';
 
-       if ((($content['timestamp'] + getConfig('holiday_lock')) > time()) || (($content['timestamp_ordered'] + getConfig('holiday_lock')) > time())) {
+       if ((($content['timestamp'] + getHolidayLock()) > time()) || (($content['timestamp_ordered'] + getHolidayLock()) > time())) {
                // Mail order is to close away!
                unsetPostRequestElement('ok');
                unsetPostRequestElement('stop');
 
-               if (($content['timestamp'] + getConfig('holiday_lock')) > time()) {
+               if (($content['timestamp'] + getHolidayLock()) > time()) {
                        // Mail found in pool
                        $stamp = $content['timestamp'];
                } else {
@@ -120,7 +120,12 @@ if (isFormSent()) {
        } else {
                // Everything went okay so let's store his request and send mails
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_holidays` (`userid`, `holiday_start`, `holiday_end`, `comments`) VALUES ('%s','%s','%s','%s')",
-                       array(getMemberId(), $START, $content['holiday_end'], postRequestElement('comments')), __FILE__, __LINE__);
+                       array(
+                               getMemberId(),
+                               $START,
+                               $content['holiday_end'],
+                               postRequestElement('comments')
+                       ), __FILE__, __LINE__);
 
                // Activate holiday system
                SQL_QUERY_ESC("UPDATE
@@ -174,7 +179,7 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__);
                // Merge arrays
                $content = merge_array($content, SQL_FETCHARRAY($result));
 
-               if (($content['holiday_active'] == 'Y') && (($content['holiday_activated'] + getConfig('holiday_lock')) < time())) {
+               if (($content['holiday_active'] == 'Y') && (($content['holiday_activated'] + getHolidayLock()) < time())) {
                        // Load data
                        $result2 = SQL_QUERY_ESC("SELECT
        `holiday_start`,
@@ -251,7 +256,7 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__);
        SQL_FREERESULT($result);
 
        // Check for lock
-       if (($content['holiday_activated'] + getConfig('holiday_lock')) < time()) {
+       if (($content['holiday_activated'] + getHolidayLock()) < time()) {
                // User can deactivate his holiday request
                switch ($content['holiday_active']) {
                        case 'Y': // Display deactivation form
@@ -274,7 +279,7 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__);
                                        $content['lock']  = generateDateTime($content['holiday_activated'], 1);
 
                                        // Load template
-                                       loadTemplate('member_holiday_deactivate', false, $content);
+                                       loadTemplate('member_holiday_deactivate', FALSE, $content);
                                } else {
                                        // Free memory
                                        SQL_FREERESULT($result);
@@ -312,7 +317,7 @@ LIMIT 1",
                                $content['end_year']  = addSelectionBox('year' , getYear($endingStamp) , 'end');
 
                                // Output form
-                               loadTemplate('member_holiday_form', false, $content);
+                               loadTemplate('member_holiday_form', FALSE, $content);
                                break;
                } // END - switch
        } else {