Jump to content

Cody

Blesta Developers
  • Posts

    1,574
  • Joined

  • Last visited

  • Days Won

    74

Posts posted by Cody

  1. Note #2: in language\en_us\custom_invoice.php

     

     

    $lang['CustomInvoice.name'] = "Default";

     

    This should be changed to something other than "Default", let's say "OurInvoices".

     

    And then Blesta will offer you "OurInvoices" under Invoice Templates field in Settings > Company > Billing/Payment > Invoice Customization.

     

    You have to select that new option and click UPDATE SETTINGS.

     

    Yes, that's correct.

  2. OK, I have done all 6 steps.

     

    Note #1: custom_invoice.php now contains things like

     

    // Use the Default Invoice PDF renderer for generating PDFs
    Loader::load(dirname(__FILE__) . DS . "default_invoice_pdf.php");
    
    ..
    
            // Load language for this template
            Language::loadLang("default_invoice", null, dirname(__FILE__) . DS . "language" . DS);
    
    
    

    should this be replaced too or not? I.e. string replace "default_invoice" -> "custom_invoice" in all files?

     

     

    I think so because otherwise the files are not loaded properly. So please, just confirm.

     

     

    Yes, replace those as well.

  3. It looks like your installation is not able to receive a response from payflowpro. Have you checked your payflow transactions to see if payflow received the transaction? If so, you may have port 443 ingress blocked at a firewall. If not, your IP address may have changed and it may not be whitelisted for your account.

     

    No changes to payflowpro were made since 3.0.3.

  4. I've been discussing this topic a little bit with Paul over support tickets. The thing is that we need invoices to be completely different from what Blesta is capable to generate right now. We are in EU and the regulations here are quite extreme, the requirements for invoices are insane, but there is nothing we can do about it. So, we have to completely change our invoices that are generated in Blesta.

     

    How do we do that? I would like to ask you for a help with following topics and please assume that we know nothing about Blesta and we have no experience with creating any kind of extensions for it:

     

    1) Where do we start? What do we want? I think we want some kind of extension (but which one?).

     

    copy and rename /components/invoice_templates/default_invoice/ to "custom_invoice" or whatever you want to call it, but here I'll assume "custom_invoice".

    1. Rename /components/invoice_templates/custom_invoice/default_invoice.php to custom_invoice.php.
    2. Rename /components/invoice_templates/custom_invoice/default_invoice_pdf.php to custom_invoice_pdf.php
    3. Rename /components/invoice_templates/custom_invoice/language/en_us/default_invoice.php to custom_invoice.php
    4. Open /components/invoice_templates/custom_invoice/custom_invoice.php and string replace "DefaultInvoice" with "CustomInvoice"
    5. Open /component/invoice_templates/custom_invoice/custom_invoice_pdf.php and string replace "DefaultInvoice" with "CustomInvoice"
    6. Open /components/invoice_templates/custom_invoice/language/en_us/custom_invoice.php and string replace "DefaultInvoice." with "CustomInvoice."

     

    2) What should we read (which part of the documentation)? Which functions are related to creating invoices.

     

    Unfortunately documentation is not currently available for Invoice Templates. Basically what you'll want to do is focus on making changes in /components/invoice_templates/custom_invoice/custom_invoice_pdf.php. It should be pretty self-explanatory.

     

    3) How do we connect our extension to Blesta - i.e. how do we replace the current invoicing system with the new one?

     

    Once you've copied/renamed as I've explained above Blesta will detect your custom invoice template.

     

    I decided to go this way because requesting such a feature from the devs would be very demanding. Understanding what is needed in our country on invoices is hard and explaining that would take so much time that I think we will faster create such an extension ourselves. But this holds only if we receive good support here. We need to understand the process of creating new Blesta extensions from the very beginning. Kindly asking for as much information as possible on this topic. I expect to be asking more question during the process. Thanks!

     

    Yes, please let us know what questions you have as it will help in creating/improving the documentation on the topic.

  5. I downloaded the patch. I think I forgot to hit the upgrade button a few times, but I uploaded the new files all the time an upgrade came out.

    Could you tell me what should I do to make this right?

     

    Thanks

     

    So you uploaded files when 3.0.2 came out, then again for 3.0.3, but you never ran the upgrade?

     

    That's not good. You might have other issues, but for now what you can do is update /components/upgrades/tasks/upgrade3_0_2.php and change line 76:

     

    From:

                $this->Record->insert("settings", array('key' => "root_web_dir", 'value' => $public_root_web));

     

    To:

                //$this->Record->insert("settings", array('key' => "root_web_dir", 'value' => $public_root_web));
  6. Please Google something about upload_tmp_dir, why does it exist and what are its problems on Windows.

     

    Just think about why upload_tmp_dir even exists? Why someone introduced it to PHP? It is there and you just need to use it, why you refuse to do that? There is no reason not to use upload_tmp_dir. Why is it called upload_tmp_dir? Why not just tmp_dir if it was the same?!

     

    Why are you trying to be condescending? Is it because you don't understand the problem? Because that's what it looks like.

     

    The temp directory in Blesta settings is for reading, writing, and moving files. That's its sole purpose. This value is configurable and must be writable by Blesta. The entire system should use this setting whenever a temp directory is needed. That is why I created CORE-808, because the support manager does not use that setting when dealing with email attachments AND IT SHOULD because where Blesta writes files to should be predictable.

     

    But if you think the default rights of Windows default temporary directory should be manipulated then the whole discussion is pointless. I can't see why you keep persisting on your UNIX/Linux based point of view when we are talking about  Windows!?

     

    Arguing the default permission on Windows is a moot point. Look, I run Blesta on Windows too. I don't have the problems you're having because my permissions just work. Maybe that's because I'm using WAMP. Regardless, the issue you're experiencing is not isolated to Windows. It's a permission issue. It can happen to users on Linux just as easily as it can happen to users on Windows.

  7. Thank you for accepting. However, [settings] > [system] > [General] > [basic Setup] does only allows you to set up temp directory and upload directory and neither should be used for this purpose. What we are talking about here is temp upload directory as I described in my post. If you change it to Temp Directory from [basic Setup] the bug will still be there because for most actions the default temporary directory is just good to be used (for things like create a temp file, do something with it and delete it). It is just unsuitable for actions where you want to move the file somewhere else.

     

    Why is that? Can't you simply set the proper permissions to your temp directory, or just update [settings] > [system] > [General] > [basic Setup] to point to the directory you setup in your php.ini file?

     

    So I suggest to reconsider your fix as it would not fix anything. It should be OK to left [basic Setup] Temp Directory with the default value which is the default temporary directory.

     

    You have this hint - if your solution does not work with the default values, it is probably not good. And you will put all your Windows users to troubles if you do it that way.

     

    The purpose of the temp directory is to write files that may be moved, read, or written to. Again, we come back to a permission issue. It isn't satisfactory to say the temp directory as defined in the settings is only good for writing/reading from but not for moving files out of. That's just silly.

  8.  

    Well, no, it's slower to execute... If anything, it is probably faster to type your way. Extra run-time parsing is done with double quotes, causing inherently slower execution. This has been debated from both sides and I don't have any benchmarks for you, but I think that it just makes sense looking at it from a high level. PHP isn't compiled, so all of these seemingly marginal considerations add up to a much larger impact than they do with C/Java, even if it is still marginal.

     

    There is essentially no performance difference (http://www.phpbench.com/). But I have neither the time nor patience to get into a protracted argument of the pros and cons of performance vs readability which are, on occasion, diametrically opposed.

     

    #1 - Power should be used with discretion, since it is usually harder to debug and slower. What power does it give you really? Variables inside strings and escape sequences other than \'? Whoopdie freaking doo!

     

    I couldn't possibly disagree more.

     

    #2 - I've never had an issue with the readability of either.

     

    Readability, while somewhat objective as you've come to find, is not about one man's issues.

     

    #3 - I figured this right off, but I know lots of other programmers with the same background who would agree with me in the case of PHP.

     

    That's nice, but they're not constrained by this style guide so their opinion is moot. Maybe they prefer spaces over tabs, I don't care.

     

    #4 - See below:

    I've written code bases with xx,xxx lines using this method and developers have picked up on it in hours not days, with no documentation, so the issue of readability is a really hard sell for me. It seems to me like your method was a decision based on familiarity and preference, not principle.

     

    It's not a big deal, conformity is most important, but the reasoning is clearly the Java/C background and not that it's ideal in PHP. I will simply write Blesta extensions using this method since it's probably too late for you guys to make a change like this now.

     

    A style guide is created and enforced by those that have their heads in the code each and every day. There are as many style guides as there are development teams. If PSR existed when we started Blesta, maybe we would have conformed to that standard instead (unlikely because tabs are better than spaces), but I digress.

  9. That error tells you that one of the required parameters (required by the resource you're requesting) is not being provided. Check the source docs to see which parameters are required and ensure you're passing them in (http://source-docs.blesta.com/class-Clients.html#_create).

     

    Since that method only requires a single parameter it looks like you're missing the "vars" parameter. You should have something like:

     

    $params = array(
        'vars' => array(
            // all indexes required by the $vars parameter as per the source docs.
        )
    );
  10. Slower to type? Because it certainly isn't slower to execute.

     

    Why have we made double quotes required for string literals? Because:

    1. Double quoted strings are more powerful.
    2. It improves readability, allowing quick identification of array indexes vs string literals.
    3. All of the Blesta devs come from a C/Java background so it's only natural from our perspective.
    4. Because of #3, if we didn't define how string literals should be handled we'd potentially have a mess of code with mixed quoting which negatively affects readability.
  11. Version 3.0.4 is now available. You can download it at https://account.blest...er/client_main/.

    This is a patch release that corrects issues with 3.0.0.

    Patching Blesta

    See Patching Blesta in the User Manual for instructions.

    Release Notes - Blesta Core - Version 3.0.4

    ## Version 3.0.4
    2013-10-07
    
    ### Bug
    * [CORE-728] - Some email templates contain URL tags not prepended with the HTTP protocol
    * [CORE-729] - Some email templates incorrectly have the HTTP(S) protocol prepended to certain URL tags at run time
    * [CORE-762] - LogicBoxes: Additional fields are shown when going back to edit service details before creating it
    * [CORE-770] - Update "uncanceled service" error message when attempting to delete a module row that is referenced by canceled services
    * [CORE-772] - Plugin::getEvents() and Plugin::getActions() not invoked after upgrade
    * [CORE-774] - Appending service to existing invoice does not recalculate invoice totals
    * [CORE-775] - Changing a tax rule's status to 'inactive' sets it to an invalid status
    * [CORE-776] - Transaction fails to apply due to rounding error
    * [CORE-777] - Tax Rules Level 2 missing zebra-striping
    * [CORE-778] - Universal Module: An empty service option row should not be saved as a valid option
    * [CORE-779] - Attempting to void a paid invoice displays an unvoid button on error
    * [CORE-780] - Editing a template may cause an undefined property Emails::$parseError if errors are set for the template
    * [CORE-781] - Support Manager: Last reply info in ticket is non-determinisitc
    * [CORE-782] - Packages with 0 quantity can still be ordered
    * [CORE-783] - Import Manager: Invalid join in Blesta 2.5 migrator
    * [CORE-784] - API: companies/generatekeypair never completes
    * [CORE-793] - Setting package prices to non-double types causes number_format error
    * [CORE-794] - Default from addresses contain port number when hostname contains port number
    * [CORE-795] - Email Log incorrectly logs email content when HTML is disabled
    * [CORE-796] - Security: XSS Vulnerability in message dialogs
    * [CORE-797] - Security: Potential XSS Vulnerability in uncaught exception messages
    * [CORE-798] - Order Plugin: Cannot add multiple addon services due to error that the parent service ID already exists as a child to another service
    * [CORE-799] - 2Checkout: Payment logo URL from 2Checkout is no longer valid
    * [CORE-801] - AppController:base_url does not contain port number, if given
    * [CORE-802] - Plesk: Canceling a service deletes all customers
    * [CORE-803] - Client payments without account set first name as last name
    * [CORE-804] - Support Manager: mailto link contains HTTP protocol
    * [CORE-805] - Namecheap: Domains not available
    
    ---
    
  12. This looks like a bug with the order plugin. Try editing line 83 of /plugins/order/controllers/main.php.

     

    From:

     

                "<link href=\"" . Router::makeURI(str_replace("index.php/", "", WEBDIR)) . $this->view->view_path . "views/" . $this->view->view . "/css/order.css\" rel=\"stylesheet\" type=\"text/css\" />"

     

     

    To:

     

                "<link href=\"" . Router::makeURI(str_replace("index.php/", "", WEBDIR) . $this->view->view_path) . "views/" . $this->view->view . "/css/order.css\" rel=\"stylesheet\" type=\"text/css\" />"
×
×
  • Create New...