| @@ 380-384 (lines=5) @@ | ||
| 377 | $datetime = $event->_add_relation_to($datetime, 'Datetime'); | |
| 378 | // before going any further make sure our dates are setup correctly | |
| 379 | // so that the end date is always equal or greater than the start date. | |
| 380 |             if ($datetime->get_raw('DTT_EVT_start') > $datetime->get_raw('DTT_EVT_end')) { | |
| 381 |                 $datetime->set('DTT_EVT_end', $datetime->get('DTT_EVT_start')); | |
| 382 | $datetime = EEH_DTT_Helper::date_time_add($datetime, 'DTT_EVT_end', 'days'); | |
| 383 | $datetime->save(); | |
| 384 | } | |
| 385 | // now we have to make sure we add the new DTT_ID to the $saved_dtt_ids array | |
| 386 | // because it is possible there was a new one created for the autosave. | |
| 387 | // (save the ID for both key and value to avoid duplications) | |
| @@ 610-613 (lines=4) @@ | ||
| 607 | // $ticket->save(); | |
| 608 | // before going any further make sure our dates are setup correctly | |
| 609 | // so that the end date is always equal or greater than the start date. | |
| 610 |             if ($ticket->get_raw('TKT_start_date') > $ticket->get_raw('TKT_end_date')) { | |
| 611 |                 $ticket->set('TKT_end_date', $ticket->get('TKT_start_date')); | |
| 612 | $ticket = EEH_DTT_Helper::date_time_add($ticket, 'TKT_end_date', 'days'); | |
| 613 | } | |
| 614 | // let's make sure the base price is handled | |
| 615 | $ticket = ! $create_new_TKT | |
| 616 | ? $this->_add_prices_to_ticket( | |
| @@ 1193-1197 (lines=5) @@ | ||
| 1190 | $DTT = $evtobj->_add_relation_to($DTM, 'Datetime'); | |
| 1191 | // load DTT helper | |
| 1192 | // before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date. | |
| 1193 |             if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) { | |
| 1194 |                 $DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start')); | |
| 1195 | $DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days'); | |
| 1196 | $DTT->save(); | |
| 1197 | } | |
| 1198 | // now we got to make sure we add the new DTT_ID to the $saved_dtts array because it is possible there was a new one created for the autosave. | |
| 1199 | $saved_dtt = $DTT; | |
| 1200 | $success = ! $success ? $success : $DTT; | |
| @@ 1325-1329 (lines=5) @@ | ||
| 1322 | // update ticket. | |
| 1323 | $TKT->save(); | |
| 1324 | // before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date. | |
| 1325 |             if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) { | |
| 1326 |                 $TKT->set('TKT_end_date', $TKT->get('TKT_start_date')); | |
| 1327 | $TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days'); | |
| 1328 | $TKT->save(); | |
| 1329 | } | |
| 1330 | // initially let's add the ticket to the dtt | |
| 1331 | $saved_dtt->_add_relation_to($TKT, 'Ticket'); | |
| 1332 | $saved_tickets[ $TKT->ID() ] = $TKT; | |