search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Passing multiple items to tags object javascript/php/exhange

Asked by Mike
22 days ago.

Had some coding that I had done about 9 months ago that kind of got put to the side, what was completed was working fine. Now trying to add to the code and running into a bit of a wall, I see now that what I did wasn't quite correct (though it worked anyway) but now I'm not sure how to fix it to carry on... more of a php/javascript issue than specifically DayPilot but anyway :-)

I was passing just the Exchange Categories object from the event using the tags object (in reality was passing just the "String" array from within the Categories object, that's where I went partially wrong initially). Now I need to pass the Categories object and the Attachments object but my brain is saying "nope" :-)

So initially in the get_data.php script I get the events from the Exchange server and then do this to get the (String array containing the category names from within the) Categories object...
$e->tags = $item->Categories;

And on the other end where im displaying the calendar, the javascript in the calendar.php script is this...
var categories = args.e.tag("String").toString();
var categoryArray = categories.split(",");
var categoryString = "";
args.e.tag("String").forEach(function(element) {
if (categoryString == "") {
categoryString = element;
} else {
categoryString = categoryString + " - " + element;
}
});

So #1... how do I change the above so that I'm passing the Categories object itself like I should have been in the first place, and not just the String array from within it?
and #2... how do I add to this so I can also access data (ultimately the number of attachments and their names) from within the Attachments object via the Tags object

So here is the source data coming from Exchange that I need to access...

["Categories"]=>
object(jamesiarmes\PhpEws\ArrayType\ArrayOfStringsType)#22 (1) {
["String"]=>
array(1) {
[0]=>
string(5) "Local"
}
}
["Attachments"]=>
object(jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfAttachmentsType)#17 (2) {
["FileAttachment"]=>
array(2) {
[0]=>
object(jamesiarmes\PhpEws\Type\FileAttachmentType)#18 (10) {
["Content"]=>
NULL
["IsContactPhoto"]=>
bool(false)
["AttachmentId"]=>
object(jamesiarmes\PhpEws\Type\AttachmentIdType)#19 (3) {
["RootItemChangeKey"]=>
NULL
["RootItemId"]=>
NULL
["Id"]=>
string(180) "AAMk$
}
["ContentId"]=>
string(0) ""
["ContentLocation"]=>
NULL
["ContentType"]=>
NULL
["IsInline"]=>
bool(false)
["LastModifiedTime"]=>
string(19) "2019-06-24T18:48:19"
["Name"]=>
string(18) "channelListPdf.pdf"
["Size"]=>
int(46177)
}
[1]=>
object(jamesiarmes\PhpEws\Type\FileAttachmentType)#20 (10) {
["Content"]=>
NULL
["IsContactPhoto"]=>
bool(false)
["AttachmentId"]=>
object(jamesiarmes\PhpEws\Type\AttachmentIdType)#21 (3) {
["RootItemChangeKey"]=>
NULL
["RootItemId"]=>
NULL
["Id"]=>
string(180) "AAMk$
}
["ContentId"]=>
string(0) ""
["ContentLocation"]=>
NULL
["ContentType"]=>
NULL
["IsInline"]=>
bool(false)
["LastModifiedTime"]=>
string(19) "2019-06-24T18:48:19"
["Name"]=>
string(19) "channelListPdf2.pdf"
["Size"]=>
int(46177)
}
}

["ItemAttachment"]=>
NULL
}

Thanks much for any hints, have been bashing my head for a bit now and its just a sliver above my knowledge level.

Cheers!

No reply yet.
New Reply
This reply is
Your name (optional):