mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
[CORE] Modif de trad et renomage pour le module askpricesupplier (#new_ask_price).
This commit is contained in:
@@ -1285,7 +1285,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
|
print '<td class="fieldrequired">' . $langs->trans('Supplier') . '</td>';
|
||||||
if ($socid > 0) {
|
if ($socid > 0) {
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $soc->getNomUrl(1);
|
print $soc->getNomUrl(1);
|
||||||
@@ -1293,7 +1293,7 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 2 OR s.client = 3', 1);
|
print $form->select_company('', 'socid', 's.fournisseur = 1', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</tr>' . "\n";
|
print '</tr>' . "\n";
|
||||||
@@ -2186,14 +2186,14 @@ if ($action == 'create')
|
|||||||
* Documents generes
|
* Documents generes
|
||||||
*/
|
*/
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->askpricesupplier->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||||
$genallowed = $user->rights->askpricesupplier->creer;
|
$genallowed = $user->rights->askpricesupplier->creer;
|
||||||
$delallowed = $user->rights->askpricesupplier->supprimer;
|
$delallowed = $user->rights->askpricesupplier->supprimer;
|
||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
$somethingshown = $formfile->show_documents('propal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
$somethingshown = $formfile->show_documents('askpricesupplier', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Linked object block
|
* Linked object block
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class modAskPriceSupplier extends DolibarrModules
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->numero = 999999;
|
$this->numero = 999999;
|
||||||
|
|
||||||
$this->family = "products";
|
$this->family = "crm";
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||||
$this->description = "askpricesupplierDESC";
|
$this->description = "askpricesupplierDESC";
|
||||||
@@ -220,11 +220,33 @@ class modAskPriceSupplier extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
function init($options='')
|
function init($options='')
|
||||||
{
|
{
|
||||||
//global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
/*CREATE IF NOT EXISTS llx_askpricesupplier (rowid int auto_increment);*/
|
// Remove permissions and default values
|
||||||
|
$this->remove($options);
|
||||||
$sql = array();
|
|
||||||
|
//ODT template
|
||||||
|
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/askpricesupplier/template_askpricesupplier.odt';
|
||||||
|
$dirodt=DOL_DATA_ROOT.'/doctemplates/askpricesupplier';
|
||||||
|
$dest=$dirodt.'/template_askpricesupplier.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->const[0][2]."' AND entity = ".$conf->entity,
|
||||||
|
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','askpricesupplier',".$conf->entity.")",
|
||||||
|
);
|
||||||
|
|
||||||
$result=$this->_load_tables('/comm/askpricesupplier/sql/');
|
$result=$this->_load_tables('/comm/askpricesupplier/sql/');
|
||||||
return $this->_init($sql, $options);
|
return $this->_init($sql, $options);
|
||||||
|
|||||||
Reference in New Issue
Block a user