diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index 52470be41068cb0fce940716b443a7fc0553a76b..8f115d3963bcd0ffd0e7994065c0a7a025c40f41 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -85,7 +85,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="action" value="update">'; -dol_fiche_head(); +//dol_fiche_head(null, '', '', -1); /* * Params @@ -122,7 +122,7 @@ print '</tr>'; print "</table>\n"; -dol_fiche_end(); +//dol_fiche_end(); print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 39865905553551a4e436bdb9e4e9a5b5d5459d0b..4c3be3cc4d15dbb86c5748f28b01ad54e00e09c5 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1706,6 +1706,12 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu if ($fuser->rights->ficheinter->lire) $accessallowed=1; $original_file=$conf->ficheinter->dir_output.'/'.$original_file; } + // Wrapping pour les apercu conat + elseif (($modulepart == 'apercucontract') && !empty($conf->contrat->dir_output)) + { + if ($fuser->rights->contrat->lire) $accessallowed=1; + $original_file=$conf->contrat->dir_output.'/'.$original_file; + } // Wrapping pour les apercu supplier proposal elseif (($modulepart == 'apercusupplier_proposal' || $modulepart == 'apercusupplier_proposal') && !empty($conf->supplier_proposal->dir_output)) { diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index c4c8cd500fbb0e6e2c18151ea03c2d525ead5441..52127c4e6f423136c93f81a10969024d8bf5421e 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -70,12 +70,29 @@ class modContrat extends DolibarrModules // Constants $this->const = array(); - $this->const[0][0] = "CONTRACT_ADDON"; - $this->const[0][1] = "chaine"; - $this->const[0][2] = "mod_contract_serpis"; - $this->const[0][3] = 'Nom du gestionnaire de numerotation des contrats'; - $this->const[0][4] = 0; - + $r=0; + + $this->const[$r][0] = "CONTRACT_ADDON"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "mod_contract_serpis"; + $this->const[$r][3] = 'Nom du gestionnaire de numerotation des contrats'; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "CONTRACT_ADDON_PDF"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "strato"; + $this->const[$r][3] = 'Name of PDF model of contract'; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "CONTRACT_ADDON_PDF_ODT_PATH"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/contracts"; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; + $r++; + // Boxes $this->boxes = array( 0=>array('file'=>'box_contracts.php','enabledbydefaulton'=>'Home'), @@ -202,8 +219,29 @@ class modContrat extends DolibarrModules // Nettoyage avant activation $this->remove($options); - $sql = array(); - + //ODT template + $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/contracts/template_contract.odt'; + $dirodt=DOL_DATA_ROOT.'/doctemplates/contracts'; + $dest=$dirodt.'/template_contract.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; + } + } + + $sql = array( + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[1][2])."' AND type = 'contract' AND entity = ".$conf->entity, + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[1][2])."','contract',".$conf->entity.")" + ); + return $this->_init($sql,$options); } } diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 7029b7ffd7823ea2f403d3736e942be69910b63d..b16c7749e4092e72f2d100b3e3333f26fec30329 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -79,17 +79,17 @@ class modFacture extends DolibarrModules $this->const = array(); $r=0; - $this->const[$r][0] = "FACTURE_ADDON_PDF"; + $this->const[$r][0] = "FACTURE_ADDON"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "crabe"; - $this->const[$r][3] = 'Name of PDF model of invoice'; + $this->const[$r][2] = "mod_facture_terre"; + $this->const[$r][3] = 'Name of numbering numerotation rules of invoice'; $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "FACTURE_ADDON"; + $this->const[$r][0] = "FACTURE_ADDON_PDF"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_facture_terre"; - $this->const[$r][3] = 'Name of numbering numerotation rules of invoice'; + $this->const[$r][2] = "crabe"; + $this->const[$r][3] = 'Name of PDF model of invoice'; $this->const[$r][4] = 0; $r++; @@ -311,8 +311,8 @@ class modFacture extends DolibarrModules } $sql = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'invoice' AND entity = ".$conf->entity, - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','invoice',".$conf->entity.")" + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[1][2])."' AND type = 'invoice' AND entity = ".$conf->entity, + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[1][2])."','invoice',".$conf->entity.")" ); return $this->_init($sql,$options);