transform into box

This commit is contained in:
Frédéric FRANCE 2021-01-02 21:01:47 +01:00
parent 5dd0b3b1c6
commit 96fbee5eaf
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1

View File

@ -193,7 +193,8 @@ class modAdherent extends DolibarrModules
//-------
$this->boxes = array(
0=>array('file'=>'box_members.php', 'enabledbydefaulton'=>'Home'),
2=>array('file'=>'box_birthdays_members.php', 'enabledbydefaulton'=>'Home')
2=>array('file'=>'box_birthdays_members.php', 'enabledbydefaulton'=>'Home'),
3=>array('file'=>'box_last_modified_members', 'enabledbydefaulton'=>'membersindex'),
);
// Permissions
@ -341,10 +342,8 @@ class modAdherent extends DolibarrModules
// Add extra fields
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
$resql = $this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{
while ($obj = $this->db->fetch_object($resql))
{
if ($resql) { // This can fail when class is used on old database (during migration for example)
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 'extra.'.$obj->name;
$fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
@ -399,24 +398,22 @@ class modAdherent extends DolibarrModules
// Permissions
$this->remove($options);
//ODT template
// ODT template
/*
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/orders';
$dest=$dirodt.'/template_order.odt';
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/orders';
$dest=$dirodt.'/template_order.odt';
if (file_exists($src) && ! file_exists($dest))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_mkdir($dirodt);
$result=dol_copy($src,$dest,0,0);
if ($result < 0)
{
$langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile',$src,$dest);
return 0;
}
}*/
if (file_exists($src) && ! file_exists($dest)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_mkdir($dirodt);
$result=dol_copy($src,$dest,0,0);
if ($result < 0) {
$langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile',$src,$dest);
return 0;
}
}*/
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type='member' AND entity = ".$conf->entity,