Jump to content

Cody

Blesta Developers
  • Posts

    1,574
  • Joined

  • Last visited

  • Days Won

    74

Posts posted by Cody

  1. It's important that the correct subdivision be assigned because it's used for taxing, mailing, and other purposes. I want to make sure we get it right. The problem I'm finding is that there is apparently no accurate data available anywhere.

  2. One problem I think we'll have is determining which subdivisions to include in countries that have multiple levels of subdivisions. For example, GB's first level is country, of which there are 3 (England, Wales, and Scotland). Obviously we can't just include those three, we have to dig deeper. However, that's not necessarily the case for other countries.

     

    I don't believe there is an automated way of determining that, which is probably why we included all subdivisions, rather than to exclude some. This is also probably why there are no correct complete data sets available. Even ISO doesn't identify which subdivisions are in common use within a country.

  3. Here's what our data provider has for ISO 3166-2 for Morocco:
     

    3166-1	3166-2	name
    MA	AGD	Agadir Ida-Outanane
    MA	AOU	Aousserd
    MA	ASZ	Assa-Zag
    MA	AZI	Azilal
    MA	BEM	Beni Mellal
    MA	BER	Berkane
    MA	BES	Ben Slimane
    MA	BOD	Boujdour
    MA	BOM	Boulmane
    MA	CAS	Casablanca
    MA	CHE	Chefchaouen
    MA	CHI	Chichaoua
    MA	CHT	Chtouka-Aït Baha
    MA	ERR	Errachidia
    MA	ESI	Essaouira
    MA	ESM	Es-Semara
    MA	FAH	Fahs-Beni Makada
    MA	FES	Fès-Dar-Dbibegh
    MA	FIG	Figuig
    MA	GUE	Guelmim
    MA	HAJ	El Hajeb
    MA	HAO	Al Haouz
    MA	HOC	Al-Hoceima
    MA	IFR	Ifrane
    MA	INE	Inezgane-Aït Melloul
    MA	JDI	El Jadida
    MA	JRA	Jerada
    MA	KEN	Kénitra
    MA	KES	Kelâat Es-Sraghna
    MA	KHE	Khémisset
    MA	KHN	Khénifra
    MA	KHO	Khouribga
    MA	LAA	Laâyoune
    MA	LAR	Larache
    MA	MED	Médiouna
    MA	MEK	Meknès
    MA	MMD	Marrakech-Médina
    MA	MMN	Marrakech-Ménara
    MA	MOH	Mohammédia
    MA	MOU	Moulay Yacoub
    MA	NAD	Nador
    MA	NOU	Nouaceur
    MA	OUA	Ouarzazate
    MA	OUD	Oued Ed-Dahab-Lagouira
    MA	OUJ	Oujda-Angad
    MA	RAB	Rabat
    MA	SAF	Safi
    MA	SAL	Salé
    MA	SEF	Sefrou
    MA	SET	Settat
    MA	SIK	Sidi Kacem
    MA	SKH	Skhirat-Témara
    MA	SYB	Sidi Youssef Ben Ali
    MA	TAI	Taourirt
    MA	TAO	Taounate
    MA	TAR	Taroudant
    MA	TAT	Tata
    MA	TAZ	Taza
    MA	TET	Tétouan
    MA	TIZ	Tiznit
    MA	TNG	Tanger-Asilah
    MA	TNT	Tan-Tan
    MA	ZAG	Zagora
    
    
    3166-1 	3166-2 	name 
    MA	1	Tanger-Tetouan
    MA	2	Gharb-Chrarda-Beni Hssen
    MA	3	Taza-Al Hoceima-Taounate
    MA	4	L'Oriental
    MA	5	Fes-Boulemane
    MA	6	Meknes-Tafilalet
    MA	7	Rabat-Salé-Zemmour-Zaer
    MA	8	Grand Casablanca
    MA	9	Chaouia-Ouardigh
    MA	10	Doukkala-Abda
    MA	11	Marrakech-Tensift-Al Haouz
    MA	12	Tadla-Azilal
    MA	13	Souss-Massa-Draa
    MA	14	Guelmim-Es Smar
    MA	15	Laayoune-Boujdour-Sakia El Hamra
    MA	16	Oued ed Dahab-Lagouira
    MA	AGD	Agadir-Ida-Outanane
    MA	AOU	Aousserd
    MA	ASZ	Assa-Zag
    MA	AZI	Azilal
    MA	BEM	Beni Mellal
    MA	BER	Berkane
    MA	BES	Ben Slimane
    MA	BOD	Boujdour
    MA	BOM	Boulemane
    MA	CAS	Casablanca [Dar el Beïda]*
    MA	CHE	Chefchaouen
    MA	CHI	Chichaoua
    MA	CHT	Chtouka-Ait Baha
    MA	ERR	Errachidia
    MA	ESI	Essaouira
    MA	ESM	Es Smara
    MA	FAH	Fahs-Beni Makada
    MA	FES	Fès-Dar-Dbibegh
    MA	FIG	Figuig
    MA	GUE	Guelmim
    MA	HAJ	El Hajeb
    MA	HAO	Al Haouz
    MA	HOC	Al Hoceïma
    MA	IFR	Ifrane
    MA	INE	Inezgane-Ait Melloul
    MA	JDI	El Jadida
    MA	JRA	Jrada
    MA	KEN	Kénitra
    MA	KES	Kelaat es Sraghna
    MA	KHE	Khemisset
    MA	KHN	Khenifra
    MA	KHO	Khouribga
    MA	LAA	Laâyoune*
    MA	LAR	Larache
    MA	MED	Mediouna
    MA	MEK	Meknès
    MA	MMD	Marrakech-Medina
    MA	MMN	Marrakech-Menara
    MA	MOH	Mohammadia
    MA	MOU	Moulay Yacoub
    MA	NAD	Nador
    MA	NOU	Nouaceur
    MA	OUA	Ouarzazate
    MA	OUD	Oued ed Dahab
    MA	OUJ	Oujda*
    MA	RAB	Rabat
    MA	SAF	Safi
    MA	SAL	Connaught Salé
    MA	SEF	Sefrou
    MA	SET	Settat
    MA	SIK	Sidi Kacem
    MA	SKH	Skhirate-Témara
    MA	SYB	Sidi Youssef Ben Ali
    MA	TAI	Taourirt
    MA	TAO	Taounate
    MA	TAR	Taroudant
    MA	TAT	Tata
    MA	TAZ	Taza
    MA	TIZ	Tiznit
    MA	TNG	Tanger-Assilah
    MA	TNT	Tan-Tan
    MA	ZAG	Zagora
    
    

    I think we may need to find a different data source, possibly directly from ISO, because the information does not appear to be correct.

  4. ISO 3166-2 is the subdivision standard. It may be that countries like Morocco and Italy have multiple subdivisions registered with ISO 3166-2. I'll look into our ISO 3166-2 dataset and see if there's a way to differentiate them.

     

    Since Blesta only allows one subdivision, Blesta should probably only include the top most subdivision, whereas now it appears that Blesta includes them all.

  5. Version 3.6.0-b1 is now available. You can download it in the Client Area.

    This is a BETA feature release. This release is not considered stable enough for production use. Please report any bugs in the 3.6 beta bug forum.

    Installing Blesta

    See Installing Blesta in the User Manual for instructions.

    Upgrading Blesta

    See Upgrading Blesta in the User Manual for instructions.

    Release Notes

    See Blesta Core - Version 3.6.0-b1.

    For older releases see all Change Logs.

  6. @naja7host, why do you rely on modifying the core? You can easily create a new invoice template and simply extend the original template, without having to write much code.

     

    /components/invoice_templates/custom_invoice/custom_invoice_pdf.php

    <?php
    require_once '../default_invoice/default_invoice_pdf.php';
    
    CustomInvoicePdf extends DefaultInvoicePdf {}
    
    

    /components/invoice_templates/custom_invoice/custom_invoice.php

    <?php
    require_once '../default_invoice/default_invoice.php';
    require_once 'customer_invoice_pdf.php';
    
    CustomInvoice extends DefaultInvoice {
        public function __construct() {
            parent::__construct();
            Language::loadLang("custom_invoice", null, dirname(__FILE__) . DS . "language" . DS);
        }
    
        public function setMeta($meta) {
            parent::setMeta($meta);
            
            // Load different language for this template if given
            if (isset($meta['language']))
                Language::loadLang("custom_invoice", $meta['language'], dirname(__FILE__) . DS . "language" . DS);
    
            $this->pdf = new CustomInvoicePdf("P", "px", $this->meta['paper_size'], true, 'UTF-8', false, $font);
            
            // Set the meta data to use for this invoice
            $this->pdf->meta = $this->meta;
        }
    }
    
    

    Then just supply your own custom language file, you can even extend the language:

     

    /components/invoice_templates/custom_invoice/language/en_us/custom_invoice.php

    <?php
    $lang['DefaultInvoice.invoice_id_code'] = "Number:";
    $lang['DefaultInvoice.date_billed'] = "Date:";
    
    
  7. Hi,

     

    I saw if i change my ip address, then i cannot continue to surf in Blesta : i need to login again.

     

    However, Blesta will still accept a page refresh, even after a change on the ip address of the visitor.

     

    I would suggest to disconnect the user even if the page is simply refreshed - not only on page changes.

     

    Cheers :)

     

     

    Blesta makes no distinction between a page refresh and visiting a separate page. Your browser probably received the HTTP 403 header and loaded from the cache instead.

  8. This reminds me of the Matrix, when Morpheus offers Neo the blue pill or the red pill. You can only choose one, and you only get one chance. There is no going back, no reordering.

     

    Would be cool if the Order plugin supported the ability (on the order form) to limit re-orders. Of course, it would only apply to that particular order form, and only to the products listed on that order form.

  9. We've recently released a Blesta extension installer so users of composer can install Blesta extensions into their Blesta installation.

     

    This makes it super easy to install open source Blesta extensions, or your own customer proprietary extensions using a private composer repository (such as satis).

     

    This installer supports the following extensions:

    • Plugins
    • Modules
    • Merchant Gateways
    • Non-merchant Gateways
    • Invoice Templates
    • Reports

     

    See the instructions for usage in the README.

     

    Note that for Plugins, Modules and Gateways, the installer simply makes these extensions available in Blesta. You still need to complete installation in Blesta, like you would normally, for each of your companies.

  10. They only "pile up" if there isnt any verification :) for exemple put a key on database that tell its still running, if so, the cron will execute returning/executing "nothing", to finish and not run in background, and they will not "pile up" :)

     

    Isnt the way that is working right now? they check the time/date on the cron database and if is not finish the cron will not run?

     

    Yes that's what Blesta does now. I'm not stating that you can't have 1 minute cron jobs that work. I'm just saying, in practice, it's not really a good idea as the risk of a collision is high.

     

     

    Plus, why have 1 minute cron jobs when you have can SMTP polling every 15 seconds? B)

  11. 1 minute cron jobs are a bad idea. It's too easy for them to pile up and execute on top of each other.

     

    If the point is to pull email from SMTP/IMAP server in near real time, create a script that runs constantly and polls the SMTP/IMAP server every 30 to 60 seconds.

     

    For example:

    <?php
    
    while (true) {
        $window = 60;
        $start = microtime(true);
        
        // TODO: do stuff
    
        $runtime = microtime(true) - $start;
        // wait until we can run again...
        sleep(max(0, (int) $window - $runtime));
    }
    
  12.  

    Order id? Didn't knew Blesta understood the concept of orders.

     

    Only thing that gets passed to payment gateways is an array of invoices.

    Serializing that, and passing that to a gateway is asking for trouble, because many gateways impose a character limit (especially European gateways, because they tend to include the transaction ID on customer's bank statement)

    It may work fine during your testing while paying single invoices, but you risk that if a customer has a longer list of overdue invoices that he finally wants to pay, it will fail.

     

    I proposed introducing a common database table for storing payment transaction information for this earlier, but the team didn't feel anything for that.

    So yes, anyone wanting to properly implement a non-merchant payment gateway module will need to create their own...

     

     

    Can use functions like this:

     

     

     

    Your solution suffers from the same serialization problem.

     

    A better solution would be something like:

     

    gateway_sessions

    uuid, gateway_id, expire_date

     

    gateway_session_invoices

    gateway_session_uuid, invoice_id, amount

     

    Then you simply pass the uuid to the gateway and read it back on the response.

  13. I don't think that'll be an issue. I meant having the ability to have Blesta download the DB for you on an automated basis. As you said, you just can't distribute the DB with Blesta but you can set it up so that it'll download it for you on an automated basis.

     

    Yeah, that's the gray area, and I'm not a lawyer, but my interpretation is that if it is completely optional and not enabled by default (e.g. the download does not happen automatically unless and until someone checks a box), then it should be ok.

×
×
  • Create New...