Fix: wrong file & problem to install model

This commit is contained in:
aspangaro 2015-06-04 21:14:30 +02:00
parent 33807c467d
commit fc5ea9f20f
2 changed files with 45 additions and 46 deletions

View File

@ -68,49 +68,48 @@ class modDon extends DolibarrModules
// Constants // Constants
$this->const = array(); $this->const = array();
$r=0;
$this->const[0] = array ( $this->const[$r][0] = "DON_ADDON_MODEL";
"DON_ADDON_MODEL", $this->const[$r][1] = "chaine";
"chaine", $this->const[$r][2] = "html_cerfafr";
"html_cerfafr", $this->const[$r][3] = 'Nom du gestionnaire de generation de recu de dons';
"Nom du gestionnaire de generation de recu de dons", $this->const[$r][4] = 0;
"0"
); $r++;
$this->const[1] = array ( $this->const[$r][0] = "DONATION_ART200";
"DONATION_ART200", $this->const[$r][1] = "yesno";
"yesno", $this->const[$r][2] = "0";
"0", $this->const[$r][3] = 'Option Française - Eligibilité Art200 du CGI';
"Option Française - Eligibilité Art200 du CGI", $this->const[$r][4] = 0;
"0"
); $r++;
$this->const[2] = array ( $this->const[$r][0] = "DONATION_ART238";
"DONATION_ART238", $this->const[$r][1] = "yesno";
"yesno", $this->const[$r][2] = "0";
"0", $this->const[$r][3] = 'Option Française - Eligibilité Art238 bis du CGI';
"Option Française - Eligibilité Art238 bis du CGI", $this->const[$r][4] = 0;
"0"
); $r++;
$this->const[3] = array ( $this->const[$r][0] = "DONATION_ART885";
"DONATION_ART885", $this->const[$r][1] = "yesno";
"yesno", $this->const[$r][2] = "0";
"0", $this->const[$r][3] = 'Option Française - Eligibilité Art885-0 V bis du CGI';
"Option Française - Eligibilité Art885-0 V bis du CGI", $this->const[$r][4] = 0;
"0"
); $r++;
$this->const[4] = array ( $this->const[$r][0] = "DONATION_MESSAGE";
"DONATION_MESSAGE", $this->const[$r][1] = "chaine";
"chaine", $this->const[$r][2] = "Thank you";
"Thank you", $this->const[$r][3] = 'Message affiché sur le récépissé de versements ou dons';
"Message affiché sur le récépissé de versements ou dons", $this->const[$r][4] = 0;
"0"
); $r++;
$this->const[5] = array ( $this->const[$r][0] = "DONATION_ACCOUNTINGACCOUNT";
"DONATION_ACCOUNTINGACCOUNT", $this->const[$r][1] = "chaine";
"chaine", $this->const[$r][2] = "7581";
"7581", $this->const[$r][3] = 'Compte comptable de remise des versements ou dons';
"Compte comptable de remise des versements ou dons", $this->const[$r][4] = 0;
"0"
);
// Boxes // Boxes
$this->boxes = array(); $this->boxes = array();
@ -153,8 +152,8 @@ class modDon extends DolibarrModules
global $conf; global $conf;
$sql = array( $sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][4]."' AND entity = ".$conf->entity, "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][4]."','donation',".$conf->entity.")", "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','donation',".$conf->entity.")",
); );
return $this->_init($sql,$options); return $this->_init($sql,$options);

View File

@ -386,7 +386,7 @@ if (is_resource($handle))
{ {
print ' '; print ' ';
print '</td><td align="center">'; print '</td><td align="center">';
print '<a href="dons.php?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
} }
print '</td>'; print '</td>';
} }