diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl
index 589e2a3f55c..a28fc430caa 100644
--- a/build/perl/virtualmin/dolibarr.pl
+++ b/build/perl/virtualmin/dolibarr.pl
@@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions()
sub script_dolibarr_versions
{
-return ( "7.0.0", "6.0.5", "5.0.7" );
+return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" );
}
sub script_dolibarr_release
@@ -263,15 +263,16 @@ if ($upgrade) {
local @params = ( [ "action", "upgrade" ],
[ "versionfrom", $upgrade->{'version'} ],
[ "versionto", $ver ],
+ [ "installlock", "444" ],
);
local $p = $ver >= 3.8 ? "step5" : "etape5";
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
return (-1, "Dolibarr wizard failed : $err") if ($err);
- # Remove the installation directory.
- local $dinstall = "$opts->{'dir'}/install";
- $dinstall =~ s/\/$//;
- $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
+ # Remove the installation directory. (deprecated)
+ # local $dinstall = "$opts->{'dir'}/install";
+ # $dinstall =~ s/\/$//;
+ # $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
}
else {
@@ -306,15 +307,18 @@ else {
[ "login", "admin" ],
[ "pass", $dompass ],
[ "pass_verif", $dompass ],
+ [ "installlock", "444" ],
);
local $p = $ver >= 3.8 ? "step5" : "etape5";
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
return (-1, "Dolibarr wizard failed : $err") if ($err);
- # Remove the installation directory and protect config file.
- local $dinstall = "$opts->{'dir'}/install";
- $dinstall =~ s/\/$//;
- $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
+ # Remove the installation directory (deprecated)
+ # local $dinstall = "$opts->{'dir'}/install";
+ # $dinstall =~ s/\/$//;
+ # $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
+
+ # Protect config file
&set_permissions_as_domain_user($d, 0644, $cfile);
&set_permissions_as_domain_user($d, 0755, $cfiledir);
}
@@ -386,6 +390,8 @@ sub script_dolibarr_check_latest
{
local ($ver) = @_;
local @vers = &osdn_package_versions("dolibarr",
+ $ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" :
+ $ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 6.0 ? "dolibarr\\-(6\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" :
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 347c29fc30d..b77759b98a3 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1286,8 +1286,11 @@ else
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
$c = new Categorie($db);
$cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
- foreach ($cats as $cat) {
- $arrayselected[] = $cat->id;
+ $arrayselected = array();
+ if (is_array($cats)) {
+ foreach ($cats as $cat) {
+ $arrayselected[] = $cat->id;
+ }
}
print $form->multiselectarray('memcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
print "";
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 39d31986511..cee9ce36edd 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -59,6 +59,9 @@ class Adherent extends CommonObject
public $mesgs;
+ /**
+ * @var string login of member
+ */
public $login;
//! Clear password in memory
@@ -68,29 +71,70 @@ class Adherent extends CommonObject
//! Encrypted password in database (always defined)
public $pass_indatabase_crypted;
+ /**
+ * @var string company name
+ * @deprecated
+ */
public $societe;
/**
- * @var Societe $company {@type Societe}
+ * @var string company name
*/
public $company;
+ /**
+ * @var int Thirdparty ID
+ */
+ public $fk_soc;
+
/**
* @var string Address
*/
public $address;
- public $zip;
+ /**
+ * @var string zipcode
+ */
+ public $zip;
+
+ /**
+ * @var string town
+ */
public $town;
- public $state_id; // Id of department
- public $state_code; // Code of department
- public $state; // Label of department
+ /**
+ * @var int Id of state
+ */
+ public $state_id;
+ /**
+ * @var string Code of state
+ */
+ public $state_code;
+
+ /**
+ * @var string Label of state
+ */
+ public $state;
+
+ /**
+ * @var string email
+ */
public $email;
- public $skype;
- public $twitter;
+ /**
+ * @var string skype account
+ */
+ public $skype;
+
+ /**
+ * @var string twitter account
+ */
+ public $twitter;
+
+ /**
+ * @var string facebook account
+ */
public $facebook;
/**
@@ -120,8 +164,12 @@ class Adherent extends CommonObject
public $morphy;
public $public;
- public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
- public $photo;
+
+ // -1:brouillon, 0:resilie, >=1:valide,paye
+ // def in common object
+ //public $statut;
+
+ public $photo;
public $datec;
public $datem;
@@ -129,21 +177,20 @@ class Adherent extends CommonObject
public $birth;
- public $note_public;
- public $note_private;
+ /**
+ * @var int id type member
+ */
+ public $typeid;
- public $typeid; // Id type adherent
- public $type; // Libelle type adherent
+ /**
+ * @var string label type member
+ */
+ public $type;
public $need_subscription;
public $user_id;
public $user_login;
- /**
- * @var int Thirdparty ID
- */
- public $fk_soc;
-
public $datefin; // From member table
// Fields loaded by fetch_subscriptions()
@@ -155,7 +202,10 @@ class Adherent extends CommonObject
public $last_subscription_amount;
public $subscriptions=array();
- public $oldcopy; // To contains a clone of this when we need to save old properties of object
+ /**
+ * @var Adherent To contains a clone of this when we need to save old properties of object
+ */
+ public $oldcopy;
/**
* @var int Entity
@@ -593,11 +643,11 @@ class Adherent extends CommonObject
$luser->societe_id=$this->societe;
$luser->birth=$this->birth;
- $luser->address=$this->address;
- $luser->zip=$this->zip;
- $luser->town=$this->town;
- $luser->country_id=$this->country_id;
- $luser->state_id=$this->state_id;
+ $luser->address=$this->address;
+ $luser->zip=$this->zip;
+ $luser->town=$this->town;
+ $luser->country_id=$this->country_id;
+ $luser->state_id=$this->state_id;
$luser->email=$this->email;
$luser->skype=$this->skype;
diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php
index 497d4748da8..031e4200268 100644
--- a/htdocs/admin/bank.php
+++ b/htdocs/admin/bank.php
@@ -397,7 +397,7 @@ print '
';
*/
//if (! empty($conf->global->MAIN_FEATURES_LEVEL))
//{
-print load_fiche_titre($langs->trans("BankAccountReleveModule"), '', '');
+print load_fiche_titre($langs->trans("Other"), '', '');
print "
\n";
diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index 431d93e2a96..6cf9c84d265 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -63,7 +63,7 @@ if ($action == 'setcoder')
$resql=$db->query($sqlp);
if (! $resql) dol_print_error($db);
}
-else if ($action == 'update')
+elseif ($action == 'update')
{
$location = GETPOST('GENBARCODE_LOCATION','alpha');
$res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity);
@@ -71,17 +71,8 @@ else if ($action == 'update')
$res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
$coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha');
$res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
-}
-else if ($action == 'updateengine')
-{
- // TODO Update engines.
-}
-if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
-{
- if (! $res > 0) $error++;
-
- if (! $error)
+ if ($res > 0)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
@@ -90,6 +81,42 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
+elseif ($action == 'updateengine')
+{
+ $sql = "SELECT rowid, coder";
+ $sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
+ $sql.= " WHERE entity = ".$conf->entity;
+ $sql.= " ORDER BY code";
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $num = $db->num_rows($resql);
+ $i = 0;
+
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+
+ if (GETPOST('coder'.$obj->rowid, 'alpha'))
+ {
+ $coder = GETPOST('coder'.$obj->rowid,'alpha');
+ $code_id = $obj->rowid;
+
+ $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
+ $sqlp.= " SET coder = '" . $coder."'";
+ $sqlp.= " WHERE rowid = ". $code_id;
+ $sqlp.= " AND entity = ".$conf->entity;
+
+ $upsql=$db->query($sqlp);
+ if (! $upsql) dol_print_error($db);
+ }
+
+ $i++;
+ }
+ }
+}
+
/*
* View
@@ -161,9 +188,12 @@ foreach($dirbarcode as $reldir)
print '
';
print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'','');
-//print "';
}
-//print '';
print "
";
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 945656962ea..a9068544e35 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -11,6 +11,7 @@
* Copyright (C) 2011-2016 Alexandre Spangaro
* Copyright (C) 2015 Ferran Marcet
* Copyright (C) 2016 Raphaël Doursenaud
+ * Copyright (C) 2018 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -995,7 +996,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
print '';
if (! empty($conf->global->MAIN_MULTILANGS))
{
- $selectedlang = GETPOSTISSET('langcode','aZ09')?GETPOST('langcode','aZ09'):$langs->defaultlang;
+ $selectedlang = GETPOSTISSET('langcode')?GETPOST('langcode', 'aZ09'):$langs->defaultlang;
if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]};
print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150');
}
diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index 3c242e8048f..55be556afb9 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -517,7 +517,6 @@ print ' ';
|