BUG-10181 Modificando la clase Calendar.
Modificar las funciones de la clase Calendar para que ahora se realize el calculo de NewDate tomando en cuenta los weekends.
This commit is contained in:
@@ -135,7 +135,6 @@ class AppDelegation extends BaseAppDelegation
|
||||
|
||||
$this->setDelTaskDueDate( $delTaskDueDate['DUE_DATE'] ); // Due date formatted
|
||||
|
||||
|
||||
if ((defined( "DEBUG_CALENDAR_LOG" )) && (DEBUG_CALENDAR_LOG)) {
|
||||
$this->setDelData( $delTaskDueDate['DUE_DATE_LOG'] ); // Log of actions made by Calendar Engine
|
||||
} else {
|
||||
@@ -291,11 +290,18 @@ class AppDelegation extends BaseAppDelegation
|
||||
$aCalendarUID = '';
|
||||
}
|
||||
|
||||
//use the dates class to calculate dates
|
||||
$dates = new dates();
|
||||
$iDueDate = $dates->calculateDate( $this->getDelDelegateDate(), $aData['TAS_DURATION'], $aData['TAS_TIMEUNIT'], //hours or days, ( we only accept this two types or maybe weeks
|
||||
$aData['TAS_TYPE_DAY'], //working or calendar days
|
||||
$this->getUsrUid(), $task->getProUid(), $aData['TAS_UID'], $aCalendarUID );
|
||||
//use the dates class to calculate dates
|
||||
$calendar = new calendar();
|
||||
|
||||
if ($calendar->pmCalendarUid == '') {
|
||||
$calendar->getCalendar(null, $task->getProUid());
|
||||
$calendar->getCalendarData();
|
||||
}
|
||||
|
||||
$iDueDate = $calendar->calculateDate( $this->getDelDelegateDate(), $aData['TAS_DURATION'], $aData['TAS_TIMEUNIT'] //hours or days, ( we only accept this two types or maybe weeks
|
||||
//$aData['TAS_TYPE_DAY'], //working or calendar days
|
||||
// $this->getUsrUid(), $task->getProUid(), $aData['TAS_UID'], $aCalendarUID
|
||||
);
|
||||
|
||||
return $iDueDate;
|
||||
}
|
||||
|
||||
@@ -175,8 +175,14 @@ class UsersProperties extends BaseUsersProperties
|
||||
}
|
||||
if (PPP_EXPIRATION_IN > 0) {
|
||||
G::LoadClass( 'dates' );
|
||||
$oDates = new dates();
|
||||
$fDays = $oDates->calculateDuration( date( 'Y-m-d H:i:s' ), $sLastUpdate );
|
||||
$oCalendar = new calendar();
|
||||
|
||||
if ($calendar->pmCalendarUid == '') {
|
||||
$calendar->getCalendar($this->usrID);
|
||||
$calendar->getCalendarData();
|
||||
}
|
||||
|
||||
$fDays = $oCalendar->calculateDuration( date( 'Y-m-d H:i:s' ), $sLastUpdate );
|
||||
if ($fDays > (PPP_EXPIRATION_IN * 24)) {
|
||||
$aErrors[] = 'ID_PPP_EXPIRATION_IN';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user