Skip to content

Commit

Permalink
Merge branch '20.0' into backport/phan/20
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd authored Aug 13, 2024
2 parents 9904b9e + 4eeee46 commit 1378cfb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 25 additions & 0 deletions htdocs/core/modules/modAgenda.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function __construct($db)
} else {
dol_print_error($this->db->lasterror());
}
//$this->const[] = array("MAIN_AGENDA_XCAL_EXPORTKEY", "chaine", "123456", "Securekey for the public link");

// New pages on tabs
// -----------------
Expand Down Expand Up @@ -585,4 +586,28 @@ public function __construct($db)
$keyforaliasextra = 'extra';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
}


/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
public function init($options = '')
{
global $conf;

// Permissions
$this->remove($options);

$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type='member' AND entity = ".((int) $conf->entity),
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','member',".((int) $conf->entity).")"
);

return $this->_init($sql, $options);
}
}
2 changes: 0 additions & 2 deletions htdocs/core/modules/modExpedition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ public function init($options = '')
}
}

$sql = array();

$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'shipping' AND entity = ".((int) $conf->entity),
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."', 'shipping', ".((int) $conf->entity).")",
Expand Down

0 comments on commit 1378cfb

Please sign in to comment.