Save Copy of Quote PDF outside of WHMCS - whmcs

I need to save a copy of the quote pdf from WHMCS to a location outside the WHMCS directory so that we can send a direct link to the quote pdf to the client.
This is how I want it to work.
We view the quote PDF inside WHMCS admin area
When the pdf is viewed, a copy is saved to www.ourdomain.com/quotes/999.pdf
Then we can send a link to the client directly to the quote at www.ourdomain.com/quotes/999.pdf
Currently, you can only view the physical quote pdf when logged in as an admin user and there is no way with any hook or includes to grab the pdf.

This can literally be done in one line of code inside of quotepdf.tpl inside your template folder.
This is very similar to the invoicepdf solution here and I tried it with the quotepdf and it worked first time!
Add this code to the bottom of the quotepdf.tpl and each time the quote pdf is viewed in admin, it will output a new version to the location defined in the path below.
$pdf->Output('/home/jucra/public_html/quotes/'.$quotenumber.'.pdf', 'F');

Related

Excel on Mac. Cannot open IQY file in Data/Get External Data/Run Web Query

I am running Excel version 16.45 on Mac.
I have created a .iqy and saved it in the Queries directory alongside certain templates which were already there.
I go to Data/Get External Data/Run Web Queries. While the templates are accessible, my file is visible but greyed out (same thing happens if I save the file in a different directory).
Would anyone be able to help?
According to your information, I would like to confirm whether the issue occurs when you follow the steps as below:
1.Create a Word file, paste the web URL.
2.Save the Word as .iqy with .txt format.
3.Choose MS-DOS as coding.
4.Create an Excel file and click "Data >Get External Data >Run Web Query (Or Run Saved Query) " of the Bar
I was able to address the issue as follows.
When navigating to the relevant directory with Finder, the '.iqy' file appears to be appropriately named (as per Image 1).
In fact, if you reach the file in Terminal, the file is saved as '.iqy.txt'.
So all I had to do is rename the file, simply removing the '.txt' string at the end.
Screen you see when navigating in Finder

Moodle PHP filehandeling

My problem is that we have made an block that opens a page witha a mform on it. And we use the editor element to start the tinyMCE editor, on the page. But when we save the output, the images oploaded to the text field is only viewable to the admin (the person who uploaded it) and in the mdl_files it sets it to be a draft file. I have been through the documentation, and i might have lost the context on the new page, but im not sure.
In Moodle, files uploaded to a form (either to a filemanager element or a text editor) are stored in a temporary 'draft' area while the form is being edited.
This is so that the actual files are not changed until the form is submitted (e.g. if an admin changed the image embedded in some text, deleting the original, you do not want anyone viewing the page during the editing to see a broken image link).
When working with files embedded in a text editor in Moodle, you need to make sure you copy all existing files into the 'draft' area before you show the form, then copy the 'draft' images into the real area, after the form is submitted.
See https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#editor for details about how to do this.
Please also note that your plugin will also need a PLUGINTYPE_PLUGINNAME_pluginfile() function in its lib.php, in order to authenticate any file requests from the user's browser and return the file contents. See any of the core activities for examples of this (e.g. mod/data/lib.php - function data_pluginfile()).

Downloading Files from a Crystal Report

I have a crystal report I am trying to pull images, word docs, and zip files onto the report as a downloadable hyperlink so that whoever prints the report will have the ability to download the "attachment" they choose locally to their desktop.
The files are stored in folders on a database server. The view in the database named "vAttachmentsReport" contains the file path which points to the folders where the images, word docs, and zip files are stored. I have attempted to create a formula:
however, still no luck. I haven't found much information or any articles/examples of anyone else doing this. Has anyone else seen any examples or created something similar?
I'm not sure about doing this in eclipse, but if you open it up in the Crystal Report Editor you can right click > Format Field and go to the Hyperlink tab. This tab gives you several options for linking other files, websites, ect. via Hyperlinks. Since your database field already has the location, I would recommend adding the name of the file from your database as a field in the report and in its Hyperlink tab select the 'A Website on the Internet' radio button. Then click the formula button and enter the name of the database field that contains your file path.
Note: this will only work if you can enter the file path into your Internet Browser's address bar and download the file. If that doesn't work you may need to add a prefix to the formula with the server's name or the website's name. To this up: you need the whole website address like "http://textfiles.com/100/914bbs.txt" as a result of your Hyperlink formula.

How to create a hyperlink to a onedrive file or folder without sharing it with anyone - and then use it

(Once the hyperlink is created I will use it in OneNote to link to a file on my own Onedrive, for only me to use !)
When I view a file in Word online the URL displayed is:
https://onedrive.live.com/view.aspx?cid=53B31F7A44698440&resid=53B31F7A44698440%2130033&app=Word
Say I want to insert a link to the file in a website or OneNote page, such that it has NOT been shared with anyone. ie Only I have permissions to view it like the file reference by the above link.
Can I simply use the above URL as a link?
I have used OneDrive sharing, but I think all the methods given result in the file being shared with other named people or publically. eg like this one:
http://1drv.ms/1zOli6p
...which when viewed in word online shows this URL:
https://onedrive.live.com/view.aspx?cid=53B31F7A44698440&resid=53B31F7A44698440%2130035&app=Word
I have been experimenting and using the URL seems to work. However, if the above does work, what I don't get is why OneNote does not allow a link to be created to a file stored on Ondrive. (On my PC it sonly seems to allow links to locally stored files).
I have used GoogleDrive which allows you to select a file and right click it to "receive a link" which you can use in the manner described above. This is a really useful feature.
Note that in a similar way, I would like to create a link that causes onedrive to open and display a chosen folder. This seems to work ok when I use a URL this one that only I have permissions to view:
https://onedrive.live.com/?cid=53B31F7A44698440&id=53B31F7A44698440%2130031
Any advise is really appreciated.
Harvey
The links you copy/paste from your browser's address bar should work just fine, as your experiments have confirmed. If you're not trying to share the content with other people, you don't need to go through the sharing flows. You can just use those URL's.
From within OneNote itself you can also get links to content by right-clicking on a page/section/notebook and clicking 'copy link to page,' 'copy link to section,' etc.
You can open folder in OneDrive online (via browser or right clicking on the folder in File Explorer then selecting "view online") and click "get link" at the top. Just cut and paste into OneNote. From there you can edit/rename the link as usual.
Oddly, OneNote has functionality to copy a FILE link using the Insert > Link, but you can't stop at the folder level.
Ideally, I'd like the above option as well as dragging a folder from OneDrive within Windows File Explorer and have it ask me if I want to copy the entire folder or create a link.
I use links in format
https://onedrive.live.com/edit.aspx?resid=fd5d9e0ac8248db7!3447 (example, not real link)
or
https://onedrive.live.com/?id=fd5d9e0ac8248db7!3447
where
fd5d9e0ac8248db7 - is your ID number, and
3447 - is ID number of element (folder, Word file, OneNote notebook, media etc.)
P.S. Link format for open .one files online and folders inside OneNote online:
https:/ /onenote.officeapps.live.com/o/onenoteframe.aspx?Fi=SDfd5d9e0ac8248db7!3447&H=emul&C=5_810_BN1-SKY-WAC-WSHI&ui=Ru-RU
(example, not real link)
where
https:/ /onenote.officeapps.live.com/o/onenoteframe.aspx?Fi=SD_____yourIDnumber___!___elementID____&H=emul&C=5_810_BN1-SKY-WAC-WSHI&ui=Ru-RU
OneDrive has a "Copy link" function in a few places that you would think does what it states. However, as soon as you select "Copy link", a share is created with the defaults of your OneDrive (which could be your organisation's). In my case, the default is share with editing permissions. This is probably the last thing you would expect when you are requesting to "Copy link". This is really quite dangerous, since the now shared link could be used by anybody if it subsequently forwarded to others.
Why would you want to copy a link? My use case is that I have a folder shared as read only with specific people. I want to give them a link to a sub-folder or file that they already have access to, but I do not want to create new permissions, that in my case give editing to anybody with the link!
It seems that the way to properly "copy a link" (literally) is as suggested ie copy the URL from the address bar.

is it possible to hyperlink to external pdf selection?

I'd like to create hyperlink references to a text selection or offset in an external PDF document, as if there were an anchor defined. E.g., http://lib.extern.org/doc1.pdf?page=3&paragraph=4 so that when the user follows the link in their browser, the PDF document opens positioned at the offset specified. I'm looking for any granularity, e.g. page, paragraph, line, word, character or even pixel em or inch offset would be acceptable. If a range for a selection could be specified that would be ideal, the purpose being to highlight and link directly to quotes in external PDF docs (to which the app has read-only access.) Seems so basic, but I haven't found a solution. Ideas?
It appears it works for page numbers
EDIT: And also check this (it should open on page 8)
There are no standards for commandline parameters for the plugins.
But if you can render a fresh PDF each time (make a copy and put in a new object via some PDF manipulation API), you can include an OpenAction that jumps to the page in question. You can even set more viewer parameters (or do some other personalization, watermarks, whatever...).