forked from Wavyzz/dolibarr
[CORE] Avancement des replace (#new_ask_price).
This commit is contained in:
104
htdocs/core/class/html.formaskpricesupplier.class.php
Normal file
104
htdocs/core/class/html.formaskpricesupplier.class.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/class/html.formpropal.class.php
|
||||
* \ingroup core
|
||||
* \brief File of class with all html predefined components
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage generation of HTML components for proposal management
|
||||
*/
|
||||
class FormAskPriceSupplier
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return combo list of differents status of a proposal
|
||||
* Values are id of table c_propalst
|
||||
*
|
||||
* @param string $selected Preselected value
|
||||
* @param int $short Use short labels
|
||||
* @return void
|
||||
*/
|
||||
function selectAskPriceSupplierStatus($selected='',$short=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst";
|
||||
$sql .= " WHERE active = 1";
|
||||
|
||||
dol_syslog(get_class($this)."::selectAskPriceSupplierStatus", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
print '<select class="flat" name="askpricesupplier_statut">';
|
||||
print '<option value=""> </option>';
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($selected == $obj->id)
|
||||
{
|
||||
print '<option value="'.$obj->id.'" selected="selected">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$obj->id.'">';
|
||||
}
|
||||
$key=$obj->code;
|
||||
if ($langs->trans("PropalStatus".$key.($short?'Short':'')) != "PropalStatus".$key.($short?'Short':''))
|
||||
{
|
||||
print $langs->trans("PropalStatus".$key.($short?'Short':''));
|
||||
}
|
||||
else
|
||||
{
|
||||
$conv_to_new_code=array('PR_DRAFT'=>'Draft','PR_OPEN'=>'Opened','PR_CLOSED'=>'Closed','PR_SIGNED'=>'Signed','PR_NOTSIGNED'=>'NotSigned','PR_FAC'=>'Billed');
|
||||
if (! empty($conv_to_new_code[$obj->code])) $key=$conv_to_new_code[$obj->code];
|
||||
print ($langs->trans("PropalStatus".$key.($short?'Short':''))!="PropalStatus".$key.($short?'Short':''))?$langs->trans("PropalStatus".$key.($short?'Short':'')):$obj->label;
|
||||
}
|
||||
print '</option>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select>';
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ abstract class ModelePDFAskPriceSupplier extends CommonDocGenerator
|
||||
/**
|
||||
* Classe mere des modeles de numerotation des references de propales
|
||||
*/
|
||||
abstract class ModeleNumRefPropales
|
||||
abstract class ModeleNumRefAskPriceSupplier
|
||||
{
|
||||
var $error='';
|
||||
|
||||
@@ -158,7 +158,7 @@ abstract class ModeleNumRefPropales
|
||||
* @return int 0 if KO, 1 if OK
|
||||
* @deprecated Use the new function generateDocument of Propal class
|
||||
*/
|
||||
function propale_pdf_create(DoliDB $db, Propal $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
function askpricesupplier_pdf_create(DoliDB $db, Propal $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
@@ -250,6 +250,11 @@ class modAskPriceSupplier extends DolibarrModules
|
||||
|
||||
/*
|
||||
*
|
||||
DROP TABLE llx_askpricesupplier_extrafields;
|
||||
DROP TABLE llx_askpricesupplierdet_extrafields;
|
||||
DROP TABLE llx_askpricesupplierdet;
|
||||
DROP TABLE llx_askpricesupplier;
|
||||
*
|
||||
* CREATE TABLE IF NOT EXISTS llx_askpricesupplier (
|
||||
rowid INT AUTO_INCREMENT,
|
||||
fk_statut INT NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user