2
0
forked from Wavyzz/dolibarr

[CORE] renomage de masse (#new_ask_price).

This commit is contained in:
phf
2015-01-28 14:48:59 +01:00
parent a9d26efee8
commit 3644f4c84c
7 changed files with 24 additions and 24 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -433,7 +433,7 @@ if (! empty($conf->propal->enabled))
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowAskPriceSupplier"),"askpricesupplier").' '.dol_trunc($obj->name,24).'</a></td>';
print '<td align="right">'.$askpricesupplierstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
@@ -505,7 +505,7 @@ if (! empty($conf->propal->enabled))
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowAskPriceSupplier"),"askpricesupplier").' '.$obj->name.'</a></td>';
print '<td align="right">'.$askpricesupplierstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';

View File

@@ -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;

View File

@@ -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.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$texte.= '<input type="hidden" name="action" value="updateMask">';
$texte.= '<input type="hidden" name="maskconstpropal" value="PROPALE_SAPHIR_MASK">';
$texte.= '<input type="hidden" name="maskconstaskpricesupplier" value="ASKPRICESUPPLIER_SAPHIR_MASK">';
$texte.= '<table class="nobordernopadding" width="100%">';
$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.= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskpropal" value="'.$conf->global->PROPALE_SAPHIR_MASK.'">',$tooltip,1,1).'</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskaskpricesupplier" value="'.$conf->global->ASKPRICESUPPLIER_SAPHIR_MASK.'">',$tooltip,1,1).'</td>';
$texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
@@ -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);

View File

@@ -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");
}

View File

@@ -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++;