Jump to content

pconkie

Frog Community Genius
  • Posts

    598
  • Joined

  • Last visited

Everything posted by pconkie

  1. pconkie

    File Uploader

    Your guesses tend to be on the money though....
  2. pconkie

    File Uploader

    Yes it did - thanks! Sorry though, just resulted in another question!
  3. pconkie

    File Uploader

    Time lapse... 1. form in a modal opens 2. Upload button pressed 3. Why does frog think i;m trying to leave? This pop-up appears for some reason. 4. Press the cancel button 5. Up-loader appears above the modal - thanks! 6. file(s) uploaded 7. And attached. So how can i get rid of steps 3 & 4? Looking in the consoles network panel for clues about what is triggering the page redirect, I can see that there is a call to preferences.profile.get (which I assume the up-loader makes, because i'm not). Is this because i'm in an app when calling the uploader, but telling it to store the files in an unopened site? In which case is it better (and I think I would prefer it) to store the documents in a shared folder - would that prevent the page navigation warning pop-up? If so, what do i need to change to have the files upload to a folder? Full code... obj.modal = this.modal(title, this.view(body+'.ejs', frm_data), "modal-4FDC8814200489BB58471FBB81DE9B03CD461BECB489AFEC", null, false); obj.modal.find(".modal-footer").append("<button data-action='modal-save' class='btn btn-success'>Save</button>") if (edit == true) { obj.modal.find(".modal-footer").append("<button class='btn btn-danger' data-action='modal-delete'>Delete</button>"); } obj.modal.find(".modal-footer").append("<button class='btn btn-default' data-action='modal-close'>Cancel</button>"); obj.modal.find("[data-action=modal-delete]").click(function() { var rec = obj.modal.find("input[name=uuid]").val(); this.deleteInt(rec); this.hideModal(obj.modal); }.bind(this)); obj.modal.find("[data-action=modal-close]").click(function() { this.hideModal(obj.modal); }.bind(this)); obj.modal.find("[data-name=file-upload]").click(function() { $('.os_core:first').trigger('os.app.upload', { "data": { "upload_type": "asset", "site_uuid": "62D4442D2002520CF7345F0960EDDD095847DB4C186723A6", "focusApp": this.element.closest('div.app_dialog'), "launchAboveModal": true, "callback": function(result) { if (result.files && result.files.length) { var $docholder = obj.modal.find("input[name=docs]"); var docs = JSON.parse($docholder.val()); $.each(result.files, function(i, file) { obj.modal.find("div[data-name=uploads]").append("<div style='clear:both'><div style='float:left' class='os-icon-ext os-icon-ext-"+file.attachment.file.mime.ext+" small'></div>&nbsp;"+file.attachment.name+"."+file.attachment.file.mime.ext+"</div>"); docs.push({name:file.attachment.name,ext:file.attachment.file.mime.ext,url:file.external_url,uuid:file.uuid}); }); $docholder.val(JSON.stringify(docs)); } } } });
  4. pconkie

    File Uploader

    @adamw I think you deserve a pay rise!
  5. pconkie

    File Uploader

    I’ve still not found a way around this. @adamw any luck?
  6. opening from.... iow the button press will open the site you want to open.
  7. You have a colon where a semi-colon should be!
  8. pconkie

    File Uploader

    obj.modal = this.modal(title, this.view(body+'.ejs', frm_data), "modal-4FDC8814200489BB58471FBB81DE9B03CD461BECB489AFEC", null, false); This is the line i should have included to show that it is the built in modal, The uploader app called from the data-viewer app modals has some custom classes which presumably put it above the modal overlay. It doesn't work when i add the same classes though...
  9. pconkie

    File Uploader

    @adamw any ideas?
  10. pconkie

    File Uploader

    Good idea and where I started but... All of the windows inside frog seem to be managed by a library which continually updates z values as sites and apps are opened, closed, resized and dragged. This is why sites appear on top of each other in the correct order etc While I can change the z-index for a moment it quickly reverts back....
  11. Saw this last week myself too. @Graham Quince this has been fixed on my box, can you re-release when you have time?
  12. pconkie

    File Uploader

    I've put a non frog form inside a modal to turn it into a custom pop-up form. We have decided we need the ability to upload files to the form, so I have added a button which opens the file up-loader. The problem is the file up-loader opens beneath the modal and can not be interacted with. Here is the code i'm using: obj.modal.find("[data-name=file-upload]").click(function() { $('.os_core:first').trigger('os.app.upload', { "data": { "upload_type": "asset", "site_uuid": "62D4442D2002520CF7345F0960EDDD095847DB4C186723A6", "focusApp": $('.modal'), "callback": function(result) { if (result.files && result.files.length) { $.each(result.files, function(i, file) { console.log(file.attachment.name); }); } } } }); I've tried playing around with the focusApp option, but no luck. How do I get the file up-loader above the modal. The data-viewer app manages this - So hoping there is just a quick option to set to get this to work properly! Thanks.
  13. Thanks @Jay As we no longer send paper reports home, this is the only way parents can view them. To take the widget away all together, would make the situation far worse! I think I'll stick with the cog hidden, safe in the knowledge that the development team are on it!
  14. Ok. This seems to have hidden the cog on the preview app. Advice please on if that will hide other things in other places that we do not wish to hide. <style> .os-preview-download-holder .btn-group { display:none; } </style>
  15. Just got off the phone with another parent....At first I thought something else must be the case as I thought it was impossible to remove linked documents, but...... If a parents opens a linked document like this... There is a (new?) edit option on the cog... and if they change anything and press the save button, the document is permanently removed form the linked document viewer. Inspecting the api call shows that the entire resource section of the record is blank! Above i have opened the first two linked documents. Document 0 has had me edit the properties and the resource section is now blank "[ ]". Document 2 has been left alone and looks like all of the others and appears (like all the others) in the linked document list. Two questions... How do we stop parents accessing the cog How do we get the linked documents that have been edited back? Syncing with SIMS doesn't work as the document hasn't been deleted, just the reference to it, that has been broken.
  16. Great @Graham Quince What other frogui modules are there and is there any documentation? For example is there a user selector or a subject selector? Maybe a date picker?
  17. I can’t see a link between the collection and the site the collection was created from. There is a source-uuid in the collection, but it doesn’t appear to match the uuid of the site the collection was created from?
  18. @ADT Great idea and very much needed! @Graham Q sounds like your next project! 1. Widget that only staff and admin can see * (like the button on the page viewer widget) * because if the widget is on the page that gets copied, then the widget will get copied too! 2. Essentially a button that when clicked gets the current page it is sat on and the ePortfolio collection * that the current site was the master for * May not be currently possible, so instead could provide a list of ePortfolio collections to select from 3. Button uses the "copy page" functionality of the newly updated button widget as it loops around each ePortfolio in the collection adding the new page * * This requires passing the source page (which we would have) and a sibling page (which specifies where to insert the copied page). We wouldn't have the sibling page, but could fudge this by always inserting at the end of the menu. What do you think?
  19. Frog.Model.api('groups.getMembers' etc etc //gets me all I need except pupil_number i.e. UPN FrogOS.fdp({ url: 'group/users/'+group_data[0], path: '/api/fdp/2/', type: 'GET' etc etc //gets me all I need (including pupil_number) except thumbnail //none of the other fdp group apis seem to be better I can solve the problem by doing a second call to: Frog.Widget.Model.api('users.getSummary', { 'uuid' : uuids { etc etc which does include thumbnails Just wanted to know if I had missed a single api call that had everything i needed in return?
  20. I think we are there now: var data = JSON.parse(response.response[i].data); if (data[0].child in this.receipts) { for (var x = 0; x < data.length; x++) { this.receipts[data[0].child].push(data[x]); } this.receipts[data[0].child].sort(function(a, b){return b.datetime-a.datetime}); } else { this.receipts[data[0].child] = data; this.receipts[data[0].child].sort(function(a, b){return b.datetime-a.datetime}); } @Graham Quince please feel free to take the updated widget and app. @simon brahan thanks for your help!
  21. Rather than this: var data = JSON.parse(response.response[i].data); this.receipts[data.child] = data; This seems to work: var data = JSON.parse(response.response[i].data); if (data[0].child in this.receipts) { for (var x = 0; x < data.length; x++) { this.receipts[data[0].child].push(data[x]); } } else { this.receipts[data[0].child] = data; } However, the receipts are not necessarily ion chronological order now, so we need to do a sort at some point...
  22. Assuming both parents independently read the report we might lose the first parents data when we group the data in the app. But we should be able to do something about that... Yes, I think this a really good suggestion, thanks.
  23. @Graham Quince I'm not sure I really follow. Yes, parents can currently write entries to the datastore, but only about themselves and not about their children. If they could write an entry regarding their child, it would still be 'theirs', no? I suppose you would need to implement a sort of "is this parent user the user who created this entry [created_by_uuid] or do they have a relationship to the user for whom it is about [user_uuid]" logic. If that logic isn't in the codebase then I think it should be considered. But if it's not, then I also agree there is no quick fix as it would inappropriate to grant 'global' read/write. We really need to work from lists of students (not lists of parents) with this - i'm struggling to work out how the app and widget can be re-written? I assume if the child has two parents and they both read the report the datastore will not allow for one parent to edit an entry made by the other(?) and there will therefore bu multiple entries relating to a single child. What I think you are suggesting would be very cumbersome - we would have to search through every datastore entry for a particular report looking in the data field for a child's uuid. We would have to check them all, even if we found one because there could be multiple parents. So if we wanted a year group list (say 300 in a year group) and there were 500 entries for that particular report in the datastore. This would involve doing 150,000 checks before rendering the list. Probably should avoid this. If there is a way to return the members of a group with associated parent uuids then we could use an associative array to directly access the related parent views and avoid all that looping/checking. Is this possible?
×
×
  • Create New...