diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index a7775332812..eec88a59c11 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -134,7 +134,7 @@ class AdherentType extends CommonObject $sql.= "note = '".$this->db->escape($this->note)."',"; $sql.= "vote = '".$this->db->escape($this->vote)."',"; $sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'"; - $sql .= " WHERE rowid =".$this->id; + $sql.= " WHERE rowid =".$this->id; $result = $this->db->query($sql); if ($result) @@ -252,7 +252,7 @@ class AdherentType extends CommonObject $sql = "SELECT rowid, libelle"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type"; - $sql.= " WHERE entity = ".$conf->entity; + $sql.= " WHERE entity IN (".getEntity('adherent').")"; $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 04393fa4d29..e00c967303f 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -146,7 +146,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker $buf = fgets($fp, 4096); // Test if request must be ran only for particular database or version (if yes, we must remove the -- comment) - if (preg_match('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i',$buf,$reg)) + if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg)) { $qualified=1; @@ -159,20 +159,29 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker // restrict on version if ($qualified) { - - $versionrequest=explode('.',$reg[2]); - //print var_dump($versionrequest); - //print var_dump($versionarray); - if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0) - { - $qualified=0; - } + if (! empty($reg[2])) + { + if (is_numeric($reg[2])) // This is a version + { + $versionrequest=explode('.',$reg[2]); + //print var_dump($versionrequest); + //print var_dump($versionarray); + if (! count($versionrequest) || ! count($versionarray) || versioncompare($versionrequest,$versionarray) > 0) + { + $qualified=0; + } + } + else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE + { + if (empty($conf->db->dolibarr_main_db_collation) || ($reg[2] != strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)))) $qualified=0; + } + } } if ($qualified) { // Version qualified, delete SQL comments - $buf=preg_replace('/^--\sV(MYSQL|PGSQL|)([0-9\.]+)/i','',$buf); + $buf=preg_replace('/^--\sV(MYSQL|PGSQL)([^\s]*)/i','',$buf); //print "Ligne $i qualifi?e par version: ".$buf.'
'; } } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 3eb284ec7fc..d2ecfb60d81 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -451,8 +451,6 @@ class pdf_azur extends ModelePDFPropales // Description of product line $curX = $this->posxdesc-1; - $showpricebeforepagebreak=1; - $pdf->startTransaction(); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc); $pageposafter=$pdf->getPage(); diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 09c26293bd7..e275d982da4 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -27,12 +27,14 @@ --- VMYSQLUTF8UNICODE ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; --- VMYSQLUTF8UNICODE ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODE ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; --- VMYSQLUTF8UNICODE ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODE ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; --- VMYSQLUTF8UNICODE ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci;