From 3644f4c84cd2dfed1f7a41eef1c3ca2a86ee6752 Mon Sep 17 00:00:00 2001 From: phf Date: Wed, 28 Jan 2015 14:48:59 +0100 Subject: [PATCH] [CORE] renomage de masse (#new_ask_price). --- htdocs/comm/askpricesupplier.php | 10 +++++----- .../class/askpricesupplier.class.php | 4 ++-- htdocs/comm/askpricesupplier/index.php | 4 ++-- ...bre.php => mod_askpricesupplier_marbre.php} | 6 +++--- ...hir.php => mod_askpricesupplier_saphir.php} | 18 +++++++++--------- .../modules_askpricesupplier.php | 4 ++-- .../core/modules/modAskPriceSupplier.class.php | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) rename htdocs/core/modules/askpricesupplier/{mod_propale_marbre.php => mod_askpricesupplier_marbre.php} (95%) rename htdocs/core/modules/askpricesupplier/{mod_propale_saphir.php => mod_askpricesupplier_saphir.php} (84%) diff --git a/htdocs/comm/askpricesupplier.php b/htdocs/comm/askpricesupplier.php index 1cdd560bb49..855f84a72d8 100644 --- a/htdocs/comm/askpricesupplier.php +++ b/htdocs/comm/askpricesupplier.php @@ -33,7 +33,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formpropal.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaskpricesupplier.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/askpricesupplier/class/askpricesupplier.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/askpricesupplier/modules_askpricesupplier.php'; @@ -1497,8 +1497,8 @@ if ($action == 'create') $i = 0; while ($i < $num) { $row = $db->fetch_row($resql); - $propalRefAndSocName = $row [1] . " - " . $row [2]; - $liste_ask [$row [0]] = $propalRefAndSocName; + $askPriceSupplierRefAndSocName = $row [1] . " - " . $row [2]; + $liste_ask [$row [0]] = $askPriceSupplierRefAndSocName; $i ++; } print $form->selectarray("copie_askpricesupplier", $liste_ask, 0); @@ -1579,7 +1579,7 @@ if ($action == 'create') $soc->fetch($object->socid); $head = propal_prepare_head($object); - dol_fiche_head($head, 'comm', $langs->trans('CommRequest'), 0, 'CommRequest'); + dol_fiche_head($head, 'comm', $langs->trans('CommRequest'), 0, 'askpricesupplier'); $formconfirm = ''; @@ -2308,7 +2308,7 @@ if ($action == 'create') // Tableau des parametres complementaires $formmail->param['action'] = 'send'; - $formmail->param['models'] = 'propal_send'; + $formmail->param['models'] = 'askpricesupplier_send'; $formmail->param['id'] = $object->id; $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; // Init list of files diff --git a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php index b2c7fc4dfb2..2deb897a192 100644 --- a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php +++ b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php @@ -1093,7 +1093,7 @@ class AskPriceSupplier extends CommonObject $sql.= ", dr.code as demand_reason_code, dr.label as demand_reason"; $sql.= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture as cond_reglement_libelle_doc"; $sql.= ", cp.code as mode_reglement_code, cp.libelle as mode_reglement"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_propalst as c, ".MAIN_DB_PREFIX."propal as p"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_propalst as c, ".MAIN_DB_PREFIX."askpricesupplier as p"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_mode_reglement = cp.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON p.fk_cond_reglement = cr.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON p.fk_availability = ca.rowid'; @@ -2664,7 +2664,7 @@ class AskPriceSupplier extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->lines[$i] = new PropaleLigne($this->db); + $this->lines[$i] = new AskPriceSupplierLigne($this->db); $this->lines[$i]->id = $obj->rowid; // for backward compatibility $this->lines[$i]->rowid = $obj->rowid; $this->lines[$i]->label = $obj->custom_label; diff --git a/htdocs/comm/askpricesupplier/index.php b/htdocs/comm/askpricesupplier/index.php index dcd3436bd25..ef9a37f145c 100644 --- a/htdocs/comm/askpricesupplier/index.php +++ b/htdocs/comm/askpricesupplier/index.php @@ -433,7 +433,7 @@ if (! empty($conf->propal->enabled)) print ''; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).''; + print ''.img_object($langs->trans("ShowAskPriceSupplier"),"askpricesupplier").' '.dol_trunc($obj->name,24).''; print ''.$askpricesupplierstatic->LibStatut($obj->fk_statut,$obj->facture,5).''; @@ -505,7 +505,7 @@ if (! empty($conf->propal->enabled)) print ''; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''; + print ''.img_object($langs->trans("ShowAskPriceSupplier"),"askpricesupplier").' '.$obj->name.''; print ''.$askpricesupplierstatic->LibStatut($obj->fk_statut,$obj->facture,5).''; diff --git a/htdocs/core/modules/askpricesupplier/mod_propale_marbre.php b/htdocs/core/modules/askpricesupplier/mod_askpricesupplier_marbre.php similarity index 95% rename from htdocs/core/modules/askpricesupplier/mod_propale_marbre.php rename to htdocs/core/modules/askpricesupplier/mod_askpricesupplier_marbre.php index 28260de97d8..ec5164b679c 100644 --- a/htdocs/core/modules/askpricesupplier/mod_propale_marbre.php +++ b/htdocs/core/modules/askpricesupplier/mod_askpricesupplier_marbre.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/propale/modules_propale.php'; /** * Class to manage customer order numbering rules Marbre */ -class mod_propale_marbre extends ModeleNumRefPropales +class mod_askpricesupplier_marbre extends ModeleNumRefAskPriceSupplier { var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $prefix='PR'; @@ -74,7 +74,7 @@ class mod_propale_marbre extends ModeleNumRefPropales $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."propal"; + $sql.= " FROM ".MAIN_DB_PREFIX."askpricesupplier"; $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; $sql.= " AND entity = ".$conf->entity; @@ -111,7 +111,7 @@ class mod_propale_marbre extends ModeleNumRefPropales // D'abord on recupere la valeur max $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL - $sql.= " FROM ".MAIN_DB_PREFIX."propal"; + $sql.= " FROM ".MAIN_DB_PREFIX."askpricesupplier"; $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; $sql.= " AND entity = ".$conf->entity; diff --git a/htdocs/core/modules/askpricesupplier/mod_propale_saphir.php b/htdocs/core/modules/askpricesupplier/mod_askpricesupplier_saphir.php similarity index 84% rename from htdocs/core/modules/askpricesupplier/mod_propale_saphir.php rename to htdocs/core/modules/askpricesupplier/mod_askpricesupplier_saphir.php index 503d8754684..9bfffcee262 100644 --- a/htdocs/core/modules/askpricesupplier/mod_propale_saphir.php +++ b/htdocs/core/modules/askpricesupplier/mod_askpricesupplier_saphir.php @@ -25,13 +25,13 @@ * \brief File that contains the numbering module rules Saphir */ -require_once DOL_DOCUMENT_ROOT .'/core/modules/propale/modules_propale.php'; +require_once DOL_DOCUMENT_ROOT .'/core/modules/askpricesupplier/modules_propale.php'; /** * Class of file that contains the numbering module rules Saphir */ -class mod_propale_saphir extends ModeleNumRefPropales +class mod_propale_saphir extends ModeleNumRefAskPriceSupplier { var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $error = ''; @@ -55,18 +55,18 @@ class mod_propale_saphir extends ModeleNumRefPropales $texte.= '
'; $texte.= ''; $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; - $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Proposal"),$langs->transnoentities("Proposal")); + $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("CommRequest"),$langs->transnoentities("CommRequest")); $tooltip.=$langs->trans("GenericMaskCodes2"); $tooltip.=$langs->trans("GenericMaskCodes3"); - $tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Proposal"),$langs->transnoentities("Proposal")); + $tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("CommRequest"),$langs->transnoentities("CommRequest")); $tooltip.=$langs->trans("GenericMaskCodes5"); // Parametrage du prefix $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; @@ -106,14 +106,14 @@ class mod_propale_saphir extends ModeleNumRefPropales * @param Propal $propal Object commercial proposal * @return string Value if OK, 0 if KO */ - function getNextValue($objsoc,$propal) + function getNextValue($objsoc,$askpricesupplier) { global $db,$conf; require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; // On defini critere recherche compteur - $mask=$conf->global->PROPALE_SAPHIR_MASK; + $mask=$conf->global->ASKPRICESUPPLIER_SAPHIR_MASK; if (! $mask) { @@ -121,7 +121,7 @@ class mod_propale_saphir extends ModeleNumRefPropales return 0; } - $date=$propal->datep; + $date=$askpricesupplier->datep; $customercode=$objsoc->code_client; $numFinal=get_next_value($db,$mask,'propal','ref','',$customercode,$date); diff --git a/htdocs/core/modules/askpricesupplier/modules_askpricesupplier.php b/htdocs/core/modules/askpricesupplier/modules_askpricesupplier.php index 1662e9a45bf..b9efd387da5 100644 --- a/htdocs/core/modules/askpricesupplier/modules_askpricesupplier.php +++ b/htdocs/core/modules/askpricesupplier/modules_askpricesupplier.php @@ -86,7 +86,7 @@ abstract class ModeleNumRefAskPriceSupplier function info() { global $langs; - $langs->load("propale"); + $langs->load("askpricesupplier"); return $langs->trans("NoDescription"); } @@ -98,7 +98,7 @@ abstract class ModeleNumRefAskPriceSupplier function getExample() { global $langs; - $langs->load("propale"); + $langs->load("askpricesupplier"); return $langs->trans("NoExample"); } diff --git a/htdocs/core/modules/modAskPriceSupplier.class.php b/htdocs/core/modules/modAskPriceSupplier.class.php index e9b4359ee85..f0cf2a7a40f 100644 --- a/htdocs/core/modules/modAskPriceSupplier.class.php +++ b/htdocs/core/modules/modAskPriceSupplier.class.php @@ -82,7 +82,7 @@ class modAskPriceSupplier extends DolibarrModules $this->const[$r][0] = "ASKPRICESUPPLIER_ADDON"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_propale_marbre"; + $this->const[$r][2] = "mod_askpricesupplier_marbre"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des demandes de prix fournisseurs'; $this->const[$r][4] = 0; $r++;
'.$langs->trans("Mask").':'.$form->textwithpicto('',$tooltip,1,1).''.$form->textwithpicto('',$tooltip,1,1).'