NEW : Allow extrafields list select to be dependands on other standard
list and not only other extrafields list
This commit is contained in:
parent
43942e6ea2
commit
337897e0a1
@ -597,11 +597,11 @@ abstract class CommonObject
|
||||
dol_syslog("CODE_NOT_VALID_FOR_THIS_ELEMENT");
|
||||
return -3;
|
||||
}
|
||||
|
||||
|
||||
$datecreate = dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
// Insertion dans la base
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
||||
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
||||
@ -1230,19 +1230,19 @@ abstract class CommonObject
|
||||
function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $user='', $trigkey='')
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
|
||||
|
||||
if (empty($table)) $table=$this->table_element;
|
||||
if (empty($id)) $id=$this->id;
|
||||
if (empty($format)) $format='text';
|
||||
if (empty($id_field)) $id_field='rowid';
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Special case
|
||||
if ($table == 'product' && $field == 'note_private') $field='note';
|
||||
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
|
||||
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
|
||||
else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value);
|
||||
@ -1517,7 +1517,7 @@ abstract class CommonObject
|
||||
if($mode == 1) {
|
||||
$line->subprice = 0;
|
||||
}
|
||||
|
||||
|
||||
switch ($this->element) {
|
||||
case 'propal':
|
||||
$this->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, $line->skip_update_total, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
|
||||
@ -2153,7 +2153,7 @@ abstract class CommonObject
|
||||
// Special cas
|
||||
//var_dump($this->table_element);exit;
|
||||
if ($this->table_element == 'product') $suffix='';
|
||||
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET note".$suffix." = ".(!empty($note)?("'".$this->db->escape($note)."'"):"NULL");
|
||||
$sql.= " WHERE rowid =". $this->id;
|
||||
@ -2163,7 +2163,7 @@ abstract class CommonObject
|
||||
{
|
||||
if ($suffix == '_public') $this->note_public = $note;
|
||||
else if ($suffix == '_private') $this->note_private = $note;
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->note = $note; // deprecated
|
||||
$this->note_private = $note;
|
||||
@ -2412,7 +2412,7 @@ abstract class CommonObject
|
||||
// Special case
|
||||
if ($origin == 'order') $origin='commande';
|
||||
if ($origin == 'invoice') $origin='facture';
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
||||
@ -2899,7 +2899,7 @@ abstract class CommonObject
|
||||
function isObjectUsed($id=0)
|
||||
{
|
||||
if (empty($id)) $id=$this->id;
|
||||
|
||||
|
||||
// Check parameters
|
||||
if (! isset($this->childtables) || ! is_array($this->childtables) || count($this->childtables) == 0)
|
||||
{
|
||||
@ -3341,9 +3341,9 @@ abstract class CommonObject
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
|
||||
else
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
|
||||
print '<td class="linecolmargin2 margininfos" align="right" width="50">'.$langs->trans('MarginRate').'</td>';
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
|
||||
@ -3875,7 +3875,7 @@ abstract class CommonObject
|
||||
if ($filefound)
|
||||
{
|
||||
global $db; // Required to solve a conception default in commonstickergenerator.class.php making an include of code using $db
|
||||
|
||||
|
||||
require_once $file;
|
||||
|
||||
$obj = new $classname($this->db);
|
||||
@ -3934,7 +3934,7 @@ abstract class CommonObject
|
||||
// output format that does not support UTF8.
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
|
||||
if (in_array(get_class($this), array('Adherent')))
|
||||
if (in_array(get_class($this), array('Adherent')))
|
||||
{
|
||||
$arrayofrecords = array(); // The write_file of templates of adherent class need this
|
||||
$resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, 'member', 1, $moreparams);
|
||||
@ -4195,7 +4195,7 @@ abstract class CommonObject
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$target_extrafields=$extrafields->fetch_name_optionals_label($this->table_element);
|
||||
|
||||
|
||||
//Eliminate copied source object extra_fields that do not exist in target object
|
||||
$new_array_options=array();
|
||||
foreach ($this->array_options as $key => $value) {
|
||||
@ -4244,7 +4244,7 @@ abstract class CommonObject
|
||||
{
|
||||
if (is_numeric($value)) $res=$object->fetch($value);
|
||||
else $res=$object->fetch('',$value);
|
||||
|
||||
|
||||
if ($res > 0) $this->array_options[$key]=$object->id;
|
||||
else
|
||||
{
|
||||
@ -4503,7 +4503,7 @@ abstract class CommonObject
|
||||
jQuery(document).ready(function() {
|
||||
function showOptions(child_list, parent_list)
|
||||
{
|
||||
var val = $("select[name=\"options_"+parent_list+"\"]").val();
|
||||
var val = $("select[name="+parent_list+"]").val();
|
||||
var parentVal = parent_list + ":" + val;
|
||||
if(val > 0) {
|
||||
$("select[name=\""+child_list+"\"] option[parent]").hide();
|
||||
@ -4518,7 +4518,7 @@ abstract class CommonObject
|
||||
var parent = $(this).find("option[parent]:first").attr("parent");
|
||||
var infos = parent.split(":");
|
||||
var parent_list = infos[0];
|
||||
$("select[name=\"options_"+parent_list+"\"]").change(function() {
|
||||
$("select[name="+parent_list+"]").change(function() {
|
||||
showOptions(child_list, parent_list);
|
||||
});
|
||||
});
|
||||
|
||||
@ -373,11 +373,11 @@ ExtrafieldCheckBox=Checkbox
|
||||
ExtrafieldRadio=Radio button
|
||||
ExtrafieldCheckBoxFromList= Checkbox from table
|
||||
ExtrafieldLink=Link to an object
|
||||
ExtrafieldParamHelpselect=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...<br><br>In order to have the list depending on another :<br>1,value1|parent_list_code:parent_key<br>2,value2|parent_list_code:parent_key
|
||||
ExtrafieldParamHelpselect=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...<br><br>In order to have the list depending on another complementary attribute list :<br>1,value1|options_<i>parent_list_code</i>:parent_key<br>2,value2|options_<i>parent_list_code</i>:parent_key <br><br>In order to have the list depending on another list :<br>1,value1|<i>parent_list_code</i>:parent_key<br>2,value2|<i>parent_list_code</i>:parent_key
|
||||
ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpradio=Parameters list have to be like key,value<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpsellist=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter
|
||||
ExtrafieldParamHelpchkbxlst=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter
|
||||
ExtrafieldParamHelpsellist=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
||||
ExtrafieldParamHelpchkbxlst=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list :<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
||||
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Example : Societe:societe/class/societe.class.php
|
||||
LibraryToBuildPDF=Library used for PDF generation
|
||||
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user