diff --git a/htdocs/admin/askpricesupplier.php b/htdocs/admin/askpricesupplier.php index 67cf07378b6..6307e81042c 100644 --- a/htdocs/admin/askpricesupplier.php +++ b/htdocs/admin/askpricesupplier.php @@ -65,8 +65,8 @@ if ($action == 'specimen') { $modele=GETPOST('module','alpha'); - $propal = new AskPriceSupplier($db); - $propal->initAsSpecimen(); + $askpricesupplier = new AskPriceSupplier($db); + $askpricesupplier->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; @@ -88,7 +88,7 @@ if ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($propal,$langs) > 0) + if ($module->write_file($askpricesupplier,$langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=askpricesupplier&file=SPECIMEN.pdf"); return; @@ -313,14 +313,14 @@ foreach ($dirmodels as $reldir) } print ''; - $propal=new AskPriceSupplier($db); - $propal->initAsSpecimen(); + $askpricesupplier=new AskPriceSupplier($db); + $askpricesupplier->initAsSpecimen(); // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $propal->type=0; - $nextval=$module->getNextValue($mysoc,$propal); + $askpricesupplier->type=0; + $nextval=$module->getNextValue($mysoc,$askpricesupplier); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { diff --git a/htdocs/comm/askpricesupplier.php b/htdocs/comm/askpricesupplier.php index dc0b52e1cf1..e699d546ecb 100644 --- a/htdocs/comm/askpricesupplier.php +++ b/htdocs/comm/askpricesupplier.php @@ -91,7 +91,7 @@ if ($id > 0 || ! empty($ref)) { } // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('propalcard','globalcard')); +$hookmanager->initHooks(array('askpricesuppliercard','globalcard')); $permissionnote = $user->rights->askpricesupplier->creer; // Used by the include of actions_setnotes.inc.php @@ -950,8 +950,7 @@ if (empty($reshook)) if (! $error) { // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('propaldao')); + $hookmanager->initHooks(array('askpricesupplierdao')); $parameters = array('id' => $object->id); $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been // modified by diff --git a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php index 4f1d1807953..299260807a2 100644 --- a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php +++ b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php @@ -812,8 +812,7 @@ class AskPriceSupplier extends CommonObject $action='update'; // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('propaldao')); + $hookmanager->initHooks(array('askpricesupplierdao')); $parameters=array('socid'=>$this->id); $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) @@ -1190,8 +1189,7 @@ class AskPriceSupplier extends CommonObject $action='update'; // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('propaldao')); + $hookmanager->initHooks(array('askpricesupplierdao')); $parameters=array('id'=>$this->id); $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) @@ -1336,7 +1334,7 @@ class AskPriceSupplier extends CommonObject */ function set_date_livraison($user, $date_livraison) { - if (! empty($user->rights->propal->creer)) + if (! empty($user->rights->askpricesupplier->creer)) { $sql = "UPDATE ".MAIN_DB_PREFIX."askpricesupplier "; $sql.= " SET date_livraison = ".($date_livraison!=''?"'".$this->db->idate($date_livraison)."'":'null'); @@ -1367,7 +1365,7 @@ class AskPriceSupplier extends CommonObject { $remise=trim($remise)?trim($remise):0; - if (! empty($user->rights->propal->creer)) + if (! empty($user->rights->askpricesupplier->creer)) { $remise = price2num($remise); @@ -1400,7 +1398,7 @@ class AskPriceSupplier extends CommonObject { $remise=trim($remise)?trim($remise):0; - if (! empty($user->rights->propal->creer)) + if (! empty($user->rights->askpricesupplier->creer)) { $remise = price2num($remise); @@ -1739,11 +1737,11 @@ class AskPriceSupplier extends CommonObject if ($shortlist == 1) { - $ga[$obj->propalid] = $obj->ref; + $ga[$obj->askpricesupplierid] = $obj->ref; } else if ($shortlist == 2) { - $ga[$obj->propalid] = $obj->ref.' ('.$obj->name.')'; + $ga[$obj->askpricesupplierid] = $obj->ref.' ('.$obj->name.')'; } else { @@ -1804,7 +1802,7 @@ class AskPriceSupplier extends CommonObject { // We remove directory $ref = dol_sanitizeFileName($this->ref); - if ($conf->propal->dir_output && !empty($this->ref)) + if ($conf->askpricesupplier->dir_output && !empty($this->ref)) { $dir = $conf->askpricesupplier->dir_output . "/" . $ref ; $file = $dir . "/" . $ref . ".pdf"; diff --git a/htdocs/comm/askpricesupplier/list.php b/htdocs/comm/askpricesupplier/list.php index fe9ca6812e3..bce521489e0 100644 --- a/htdocs/comm/askpricesupplier/list.php +++ b/htdocs/comm/askpricesupplier/list.php @@ -98,7 +98,7 @@ $viewstatut=$object_statut; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('propallist')); +$hookmanager->initHooks(array('askpricesupplierlist')); diff --git a/htdocs/comm/askpricesupplier/sql/llx_askpricesupplierdet.sql b/htdocs/comm/askpricesupplier/sql/llx_askpricesupplierdet.sql index 919b89fe863..56f81623708 100644 --- a/htdocs/comm/askpricesupplier/sql/llx_askpricesupplierdet.sql +++ b/htdocs/comm/askpricesupplier/sql/llx_askpricesupplierdet.sql @@ -31,5 +31,5 @@ CREATE TABLE `llx_askpricesupplierdet` ( PRIMARY KEY (`rowid`), KEY `idx_askpricesupplierdet_fk_askpricesupplierdet` (`fk_askpricesupplier`), KEY `idx_askpricesupplierdet_fk_product` (`fk_product`), - CONSTRAINT `fk_askpricesupplierdet_fk_propal` FOREIGN KEY (`fk_askpricesupplier`) REFERENCES `llx_askpricesupplier` (`rowid`) + CONSTRAINT `fk_askpricesupplierdet_fk_askpricesupplier` FOREIGN KEY (`fk_askpricesupplier`) REFERENCES `llx_askpricesupplier` (`rowid`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 diff --git a/htdocs/core/modules/askpricesupplier/doc/pdf_aurore.modules.php b/htdocs/core/modules/askpricesupplier/doc/pdf_aurore.modules.php index fafaed64885..2c817314ecb 100644 --- a/htdocs/core/modules/askpricesupplier/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/askpricesupplier/doc/pdf_aurore.modules.php @@ -688,7 +688,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier }*/ // Show payments conditions - if (empty($conf->global->PROPALE_PDF_HIDE_PAYMENTTERMCOND) && ($object->cond_reglement_code || $object->cond_reglement)) + if (empty($conf->global->ASKPRICESUPPLIER_PDF_HIDE_PAYMENTTERMCOND) && ($object->cond_reglement_code || $object->cond_reglement)) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); @@ -718,24 +718,8 @@ class pdf_aurore extends ModelePDFAskPriceSupplier $posy=$pdf->GetY()+3; } - if (empty($conf->global->PROPALE_PDF_HIDE_PAYMENTTERMCOND)) + if (empty($conf->global->ASKPRICESUPPLIER_PDF_HIDE_PAYMENTTERMCOND)) { - // Check a payment mode is defined - /* Not required on a proposal - if (empty($object->mode_reglement_code) - && ! $conf->global->FACTURE_CHQ_NUMBER - && ! $conf->global->FACTURE_RIB_NUMBER) - { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetTextColor(200,0,0); - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0); - $pdf->SetTextColor(0,0,0); - - $posy=$pdf->GetY()+1; - } - */ - // Show payment mode if ($object->mode_reglement_code && $object->mode_reglement_code != 'CHQ' @@ -1220,9 +1204,9 @@ class pdf_aurore extends ModelePDFAskPriceSupplier pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); // Show Draft Watermark - if($object->statut==0 && (! empty($conf->global->PROPALE_DRAFT_WATERMARK)) ) + if($object->statut==0 && (! empty($conf->global->ASKPRICESUPPLIER_DRAFT_WATERMARK)) ) { - pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->PROPALE_DRAFT_WATERMARK); + pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->ASKPRICESUPPLIER_DRAFT_WATERMARK); } $pdf->SetTextColor(0,0,60); @@ -1405,7 +1389,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) { $showdetails=0; - return pdf_pagefoot($pdf,$outputlangs,'PROPALE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); + return pdf_pagefoot($pdf,$outputlangs,'ASKPRICESUPPLIER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); } } diff --git a/htdocs/core/modules/askpricesupplier/modules_askpricesupplier.php b/htdocs/core/modules/askpricesupplier/modules_askpricesupplier.php index b9efd387da5..1b0095308c8 100644 --- a/htdocs/core/modules/askpricesupplier/modules_askpricesupplier.php +++ b/htdocs/core/modules/askpricesupplier/modules_askpricesupplier.php @@ -149,7 +149,7 @@ abstract class ModeleNumRefAskPriceSupplier * Create a document onto disk according to template module. * * @param DoliDB $db Database handler - * @param object $object Object proposal + * @param object $object Object askpricesupplier * @param string $modele Force model to use ('' to not force) * @param Translate $outputlangs Object langs to use for output * @param int $hidedetails Hide details of lines @@ -158,7 +158,7 @@ abstract class ModeleNumRefAskPriceSupplier * @return int 0 if KO, 1 if OK * @deprecated Use the new function generateDocument of Propal class */ -function askpricesupplier_pdf_create(DoliDB $db, Propal $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) +function askpricesupplier_pdf_create(DoliDB $db, AskPriceSupplier $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } diff --git a/htdocs/core/modules/modAskPriceSupplier.class.php b/htdocs/core/modules/modAskPriceSupplier.class.php index 289a6879578..90efaaabd76 100644 --- a/htdocs/core/modules/modAskPriceSupplier.class.php +++ b/htdocs/core/modules/modAskPriceSupplier.class.php @@ -31,7 +31,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** - * Classe de description et activation du module Propale + * Classe de description et activation du module AskPriceSupllier */ class modAskPriceSupplier extends DolibarrModules {