diff --git a/.travis.yml b/.travis.yml
index d660f89e79d..b4621de8a81 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -342,6 +342,9 @@ script:
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
+ php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
+ php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
+ php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
cd -
set +e
echo
diff --git a/build/debian/source/include-binaries b/build/debian/source/include-binaries
new file mode 100644
index 00000000000..401eae93712
--- /dev/null
+++ b/build/debian/source/include-binaries
@@ -0,0 +1 @@
+htdocs/install/doctemplates/websites/website_template-corporate.zip
\ No newline at end of file
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/dev/resources/dbmodel/dolibarr.uml b/dev/resources/dbmodel/dolibarr.uml
deleted file mode 100644
index 57078d6668b..00000000000
--- a/dev/resources/dbmodel/dolibarr.uml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dev/resources/dbmodel/dolibarr.umldi b/dev/resources/dbmodel/dolibarr.umldi
deleted file mode 100644
index ff97a2a25b1..00000000000
--- a/dev/resources/dbmodel/dolibarr.umldi
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dev/resources/dbmodel/dolibarr_schema.mwb b/dev/resources/dbmodel/dolibarr_schema.mwb
index aec0f2d2299..80d1d612d65 100644
Binary files a/dev/resources/dbmodel/dolibarr_schema.mwb and b/dev/resources/dbmodel/dolibarr_schema.mwb differ
diff --git a/doc/install/README b/doc/install/README
index 83bc6484cea..0c7341b196c 100644
--- a/doc/install/README
+++ b/doc/install/README
@@ -7,12 +7,12 @@ Download
--------------------------------
* Dolibarr ERP/CRM can be downloaded at sourceforge:
-http://sourceforge.net/projects/dolibarr/files
-or from Dolibarr official web site:
-http://www.dolibarr.org
+ https://sourceforge.net/projects/dolibarr/files
+ or from Dolibarr official web site:
+ https://www.dolibarr.org
* Most external modules are only available on DoliStore:
-http://www.dolistore.org
+ https://www.dolistore.com
--------------------------------
@@ -22,4 +22,4 @@ Install
* For a Quick guide, take a look at README file into root directory.
* More complete documentations are also available on line on the Dolibarr Wiki:
-http://wiki.dolibarr.org
+ https://wiki.dolibarr.org
diff --git a/doc/install/README-DE b/doc/install/README-DE
new file mode 100644
index 00000000000..c7ece3891f3
--- /dev/null
+++ b/doc/install/README-DE
@@ -0,0 +1,33 @@
+README (deutsch / german / allemand)
+--------------------------------
+
+
+--------------------------------
+Download / Herunterladen
+--------------------------------
+
+* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website
+ https://www.dolibarr.org/downloads
+ oder direkt von Sourceforge
+ https://sourceforge.net/projects/dolibarr/files/
+ herunterladen.
+
+
+
+* Die meisten externen Module/Themens sind über den DoliStore verfügbar:
+ https://www.dolistore.com/de/
+
+
+--------------------------------
+Installation
+--------------------------------
+
+* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis.
+
+* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
+ https://wiki.dolibarr.org/index.php/Hauptseite
+
+* eine Deutsche Community bietet der Dolibarr e.V. unter
+ https://www.dolibarr.de/
+
+
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/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php
index 7b8f453c94c..29f1f94e683 100644
--- a/htdocs/adherents/class/subscription.class.php
+++ b/htdocs/adherents/class/subscription.class.php
@@ -337,11 +337,14 @@ class Subscription extends CommonObject
/**
* Return clicable name (with picto eventually)
*
- * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
- * @param int $notooltip 1=Disable tooltip
- * @return string Chaine avec URL
+ * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
+ * @param int $notooltip 1=Disable tooltip
+ * @param string $option Page for link ('', 'nolink', ...)
+ * @param string $morecss Add more css on link
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @return string Chaine avec URL
*/
- function getNomUrl($withpicto=0, $notooltip=0)
+ function getNomUrl($withpicto=0, $notooltip=0, $option='', $morecss='', $save_lastsearch_value=-1)
{
global $langs;
@@ -350,8 +353,18 @@ class Subscription extends CommonObject
$langs->load("members");
$label=$langs->trans("ShowSubscription").': '.$this->ref;
- $linkstart = '';
- $linkend='';
+ $url = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$this->id;
+
+ if ($option != 'nolink')
+ {
+ // Add param to save lastsearch_values or not
+ $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
+ if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
+ if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
+ }
+
+ $linkstart = '';
+ $linkend = '';
$picto='payment';
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 39d0069ac7c..8eb7109d9ed 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -79,8 +79,9 @@ $pagenext = $page + 1;
if (! $sortorder) { $sortorder=($filter=='outofdate'?"DESC":"ASC"); }
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.lastname"); }
-// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Adherent($db);
+
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('memberlist'));
$extrafields = new ExtraFields($db);
@@ -348,8 +349,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
-// 'presend'=>$langs->trans("SendByMail"),
-// 'builddoc'=>$langs->trans("PDFMerge"),
+ //'presend'=>$langs->trans("SendByMail"),
+ //'builddoc'=>$langs->trans("PDFMerge"),
);
if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
@@ -603,6 +604,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="c
print "\n";
$i = 0;
+$totalarray=array();
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($resql);
@@ -631,6 +633,7 @@ while ($i < min($num, $limit))
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
{
print '
'.$obj->rowid.' | ';
+ if (! $i) $totalarray['nbfield']++;
}
// Ref
@@ -639,6 +642,7 @@ while ($i < min($num, $limit))
print "";
print $memberstatic->getNomUrl(-1, 0, 'card', 'ref');
print " | \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Civility
if (! empty($arrayfields['d.civility']['checked']))
@@ -646,6 +650,7 @@ while ($i < min($num, $limit))
print "";
print $obj->civility;
print " | \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Firstname
if (! empty($arrayfields['d.firstname']['checked']))
@@ -653,6 +658,7 @@ while ($i < min($num, $limit))
print "";
print $obj->firstname;
print " | \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Lastname
if (! empty($arrayfields['d.lastname']['checked']))
@@ -660,6 +666,7 @@ while ($i < min($num, $limit))
print "";
print $obj->lastname;
print " | \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Company
if (! empty($arrayfields['d.company']['checked']))
@@ -672,11 +679,13 @@ while ($i < min($num, $limit))
if (! empty($arrayfields['d.login']['checked']))
{
print "".$obj->login." | \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Moral/Physique
if (! empty($arrayfields['d.morphy']['checked']))
{
print "".$memberstatic->getmorphylib($obj->morphy)." | \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Type label
if (! empty($arrayfields['t.libelle']['checked']))
@@ -686,6 +695,7 @@ while ($i < min($num, $limit))
print '';
print $membertypestatic->getNomUrl(1,32);
print ' | ';
+ if (! $i) $totalarray['nbfield']++;
}
// Address
if (! empty($arrayfields['d.address']['checked']))
@@ -693,6 +703,7 @@ while ($i < min($num, $limit))
print '';
print $obj->address;
print ' | ';
+ if (! $i) $totalarray['nbfield']++;
}
// Zip
if (! empty($arrayfields['d.zip']['checked']))
@@ -828,6 +839,36 @@ while ($i < min($num, $limit))
$i++;
}
+// Show total line
+if (isset($totalarray['pos']))
+{
+ print '';
+ $i=0;
+ while ($i < $totalarray['nbfield'])
+ {
+ $i++;
+ if (! empty($totalarray['pos'][$i])) print '| '.price($totalarray['val'][$totalarray['pos'][$i]]).' | ';
+ else
+ {
+ if ($i == 1)
+ {
+ if ($num < $limit) print ''.$langs->trans("Total").' | ';
+ else print ''.$langs->trans("Totalforthispage").' | ';
+ }
+ else print ' | ';
+ }
+ }
+ print '
';
+}
+
+// If no record found
+if ($num == 0)
+{
+ $colspan=1;
+ foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
+ print '| '.$langs->trans("NoRecordFound").' |
';
+}
+
$db->free($resql);
$parameters=array('sql' => $sql);
diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php
index 94950f02b05..e458bf093f6 100644
--- a/htdocs/adherents/subscription/card.php
+++ b/htdocs/adherents/subscription/card.php
@@ -191,7 +191,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment');
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
print "\n";
print '';
@@ -290,7 +290,7 @@ if ($rowid && $action != 'edit')
print '';
+
// End of page
llxFooter();
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/emailcollector_card.php b/htdocs/admin/emailcollector_card.php
index ff037f67aa1..2fb5013b4f9 100644
--- a/htdocs/admin/emailcollector_card.php
+++ b/htdocs/admin/emailcollector_card.php
@@ -380,11 +380,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$sourcedir = $object->source_directory;
$targetdir = ($object->target_directory ? $object->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag'
- $connectstringserver = $object->getConnectStringIMAP();
- $connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);
- $connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir);
+ $connection = null;
+ $connectstringserver = '';
+ $connectstringsource = '';
+ $connectstringtarget = '';
+
+ if (function_exists('imap_open'))
+ {
+ $connectstringserver = $object->getConnectStringIMAP();
+ $connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);
+ $connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir);
- $connection = imap_open($connectstringsource, $object->user, $object->password);
+ $connection = imap_open($connectstringsource, $object->user, $object->password);
+ }
+ else
+ {
+ $morehtml .= 'IMAP functions not available on your PHP';
+ }
+
if (! $connection)
{
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
@@ -395,8 +408,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtml .= imap_num_msg($connection);
}
- imap_close($connection);
-
+ if ($connection)
+ {
+ imap_close($connection);
+ }
+
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref.''.$morehtml.'
', '', 0, '', '', 0, '');
print '';
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 945656962ea..79614cbd3a0 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
@@ -447,8 +448,6 @@ $sql.=$db->plimit($listlimit+1,$offset);
$fieldlist=explode(',',$tabfield[$id]);
// Form to add a new line
-$alabelisused=0;
-
print '