Skip to content
Snippets Groups Projects
Commit fe1c06b1 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch '1069046_FixUserWithoutCalenderIdBetterError' into '2020.2'

[Projekt: Entwicklung - xRM][TicketNr.: 1069046][User mit fehlender...

See merge request xrm/basic!540
parents 92716091 ccb74be0
No related branches found
No related tags found
No related merge requests found
import("system.tools");
import("system.SQLTYPES");
import("system.db");
import("system.datetime");
......@@ -8,45 +9,49 @@ import("Sql_lib");
import("system.calendars");
import("Calendar_lib");
var pFilter = CalendarUtil.reset_filterEvent();
var conditions = [];
var conditioncount = 0;
var user = undefined;
var stati = [];
var entries = [];
var calendarId = tools.getCurrentUser()[tools.PARAMS][tools.CALENDARID];
if(calendarId != "" && calendarId != null && calendarId != undefined)
{
var pFilter = CalendarUtil.reset_filterEvent();
var conditions = [];
var conditioncount = 0;
var user = undefined;
var stati = [];
var entries = [];
var startnumber = Number(vars.get("$sys.date"));
var endnumber = startnumber + 43200000 ;
var startnumber = Number(vars.get("$sys.date"));
var endnumber = startnumber + 43200000 ;
var start = startnumber + "";
var end = endnumber + "";
var start = startnumber + "";
var end = endnumber + "";
if ( pFilter.tentative == "true" )
stati.push(calendars.STATUS_TENTATIVE);
if ( pFilter.tentative == "true" )
stati.push(calendars.STATUS_TENTATIVE);
if ( pFilter.cancelled == "true" )
stati.push(calendars.STATUS_CANCELLED);
if ( pFilter.cancelled == "true" )
stati.push(calendars.STATUS_CANCELLED);
if ( pFilter.confirmed == "true" )
stati.push(CalendarUtil.mapCalendarStatus(calendars.STATUS_CONFIRMED, calendars.getBackendType() ));
if ( pFilter.confirmed == "true" )
stati.push(CalendarUtil.mapCalendarStatus(calendars.STATUS_CONFIRMED, calendars.getBackendType() ));
if (CalendarUtil.getCalendarSystemType(calendars.VEVENT) == calendars.BACKEND_EXCHANGEWS && pFilter.free == "true")
stati.push(calendars.STATUS_FREE);
if (CalendarUtil.getCalendarSystemType(calendars.VEVENT) == calendars.BACKEND_EXCHANGEWS && pFilter.free == "true")
stati.push(calendars.STATUS_FREE);
if ( pFilter.user != "" )
user = (pFilter.user).trim();
if ( pFilter.user != "" )
user = (pFilter.user).trim();
for ( var z = 0; z < stati.length; z++ )
CalendarUtil.addEntryCondition(conditions, ++conditioncount,
{
TYPE: calendars.VEVENT,
START: start,
END: end,
USER: user,
STATUS: stati[z]
});
for ( var z = 0; z < stati.length; z++ )
CalendarUtil.addEntryCondition(conditions, ++conditioncount,
{
TYPE: calendars.VEVENT,
START: start,
END: end,
USER: user,
STATUS: stati[z]
});
conditions["COUNT"] = String(conditioncount);
entries = calendars.getEntries(conditions);
conditions["COUNT"] = String(conditioncount);
entries = calendars.getEntries(conditions);
result.string(entries.length);
result.string(entries.length);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment