Fix: merge conflict
This commit is contained in:
parent
e5c0a99584
commit
0cff48f9b3
@ -1534,13 +1534,13 @@ abstract class CommonObject
|
|||||||
$sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')";
|
$sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')";
|
||||||
$sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')";
|
$sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')";
|
||||||
}
|
}
|
||||||
print $sql;
|
//print $sql;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetchObjectLink sql=".$sql);
|
dol_syslog(get_class($this)."::fetchObjectLink sql=".$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows($resql); echo 'num='.$num.'<br>';
|
$num = $this->db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -1549,14 +1549,13 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
$this->linkedObjectsIds[$obj->targettype][]=$obj->fk_target;
|
$this->linkedObjectsIds[$obj->targettype][]=$obj->fk_target;
|
||||||
}
|
}
|
||||||
echo 'fk_target='.$obj->fk_target.' targetid='.$targetid.'<br>';
|
|
||||||
if ($obj->fk_target == $targetid)
|
if ($obj->fk_target == $targetid)
|
||||||
{
|
{
|
||||||
$this->linkedObjectsIds[$obj->sourcetype][]=$obj->fk_source;
|
$this->linkedObjectsIds[$obj->sourcetype][]=$obj->fk_source;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
var_dump($this->linkedObjectsIds);
|
|
||||||
if (! empty($this->linkedObjectsIds))
|
if (! empty($this->linkedObjectsIds))
|
||||||
{
|
{
|
||||||
foreach($this->linkedObjectsIds as $objecttype => $objectids)
|
foreach($this->linkedObjectsIds as $objecttype => $objectids)
|
||||||
|
|||||||
@ -238,9 +238,9 @@ class Conf
|
|||||||
if (! empty($this->global->MAIN_MODULE_MULTICOMPANY) && ! empty($this->entity) && $this->entity > 1)
|
if (! empty($this->global->MAIN_MODULE_MULTICOMPANY) && ! empty($this->entity) && $this->entity > 1)
|
||||||
{
|
{
|
||||||
$rootfordata.='/'.$this->entity;
|
$rootfordata.='/'.$this->entity;
|
||||||
var_dump($mc->sharings);
|
//var_dump($mc->sharings);
|
||||||
//var_dump($mc->referent);
|
//var_dump($mc->referent);
|
||||||
var_dump($mc->entities);
|
//var_dump($mc->entities);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For backward compatibility
|
// For backward compatibility
|
||||||
|
|||||||
@ -35,9 +35,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Form
|
* Class to manage generation of HTML components
|
||||||
* \brief Class to manage generation of HTML components
|
* Only common components must be here.
|
||||||
* \remarks Only common components must be here.
|
|
||||||
*/
|
*/
|
||||||
class Form
|
class Form
|
||||||
{
|
{
|
||||||
@ -119,9 +118,10 @@ class Form
|
|||||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height', 'select:xxx'...)
|
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height', 'select:xxx'...)
|
||||||
* @param string $editvalue When in edit mode, use this value as $value instead of value
|
* @param string $editvalue When in edit mode, use this value as $value instead of value
|
||||||
* @param object $extObject External object
|
* @param object $extObject External object
|
||||||
|
* @param string $success Success message
|
||||||
* @return string HTML edit field
|
* @return string HTML edit field
|
||||||
*/
|
*/
|
||||||
function editfieldval($text,$htmlname,$value,$object,$perm,$typeofdata='string',$editvalue='',$extObject=false)
|
function editfieldval($text,$htmlname,$value,$object,$perm,$typeofdata='string',$editvalue='',$extObject=null,$success=null)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ class Form
|
|||||||
// When option to edit inline is activated
|
// When option to edit inline is activated
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
|
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
|
||||||
{
|
{
|
||||||
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $extObject);
|
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $extObject, $success);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -195,9 +195,10 @@ class Form
|
|||||||
* @param int $condition Condition to edit
|
* @param int $condition Condition to edit
|
||||||
* @param string $inputType Type of input ('numeric', 'datepicker', 'textarea', 'ckeditor:dolibarr_zzz', 'select:xxx')
|
* @param string $inputType Type of input ('numeric', 'datepicker', 'textarea', 'ckeditor:dolibarr_zzz', 'select:xxx')
|
||||||
* @param object $extObject External object
|
* @param object $extObject External object
|
||||||
|
* @param string $success Success message
|
||||||
* @return string HTML edit in place
|
* @return string HTML edit in place
|
||||||
*/
|
*/
|
||||||
private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $extObject=false)
|
private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $extObject=null, $success=null)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -239,7 +240,7 @@ class Form
|
|||||||
$inputType=$tmp[0]; $inputOption=$tmp[1];
|
$inputType=$tmp[0]; $inputOption=$tmp[1];
|
||||||
if (! empty($tmp[2])) $savemethod=$tmp[2];
|
if (! empty($tmp[2])) $savemethod=$tmp[2];
|
||||||
}
|
}
|
||||||
if (preg_match('/^datepicker/',$inputType))
|
else if (preg_match('/^datepicker/',$inputType))
|
||||||
{
|
{
|
||||||
$tmp=explode(':',$inputType);
|
$tmp=explode(':',$inputType);
|
||||||
$inputType=$tmp[0]; $inputOption=$tmp[1];
|
$inputType=$tmp[0]; $inputOption=$tmp[1];
|
||||||
@ -277,6 +278,7 @@ class Form
|
|||||||
$out.= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
|
$out.= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
|
||||||
$out.= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
|
$out.= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
|
||||||
$out.= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
|
$out.= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
|
||||||
|
if (! empty($success)) $out.= '<input id="success_'.$htmlname.'" value="'.$success.'" type="hidden"/>'."\n";
|
||||||
//$out.= '<input id="ext_table_element_'.$htmlname.'" value="'.$ext_table_element.'" type="hidden"/>'."\n";
|
//$out.= '<input id="ext_table_element_'.$htmlname.'" value="'.$ext_table_element.'" type="hidden"/>'."\n";
|
||||||
//$out.= '<input id="ext_fk_element_'.$htmlname.'" value="'.$ext_fk_element.'" type="hidden"/>'."\n";
|
//$out.= '<input id="ext_fk_element_'.$htmlname.'" value="'.$ext_fk_element.'" type="hidden"/>'."\n";
|
||||||
|
|
||||||
@ -372,7 +374,8 @@ class Form
|
|||||||
if (empty($conf->use_javascript_ajax))
|
if (empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
if ($type == 'info' || $type == 'help') return $text;
|
if ($type == 'info' || $type == 'help') return $text;
|
||||||
else { $alt=$htmltext; $htmltext=''; }
|
else { $alt=$htmltext; $htmltext='';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// If info or help with smartphone, show only text
|
// If info or help with smartphone, show only text
|
||||||
if (! empty($conf->browser->phone))
|
if (! empty($conf->browser->phone))
|
||||||
@ -393,9 +396,10 @@ class Form
|
|||||||
/**
|
/**
|
||||||
* Return combo list of activated countries, into language of user
|
* Return combo list of activated countries, into language of user
|
||||||
*
|
*
|
||||||
* @param selected Id or Code or Label of preselected country
|
* @param string $selected Id or Code or Label of preselected country
|
||||||
* @param htmlname Name of html select object
|
* @param string $htmlname Name of html select object
|
||||||
* @param htmloption Options html on select object
|
* @param string $htmloption Options html on select object
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function select_pays($selected='',$htmlname='pays_id',$htmloption='')
|
function select_pays($selected='',$htmlname='pays_id',$htmloption='')
|
||||||
{
|
{
|
||||||
@ -405,9 +409,9 @@ class Form
|
|||||||
/**
|
/**
|
||||||
* Return combo list of activated countries, into language of user
|
* Return combo list of activated countries, into language of user
|
||||||
*
|
*
|
||||||
* @param selected Id or Code or Label of preselected country
|
* @param string $selected Id or Code or Label of preselected country
|
||||||
* @param htmlname Name of html select object
|
* @param string $htmlname Name of html select object
|
||||||
* @param htmloption Options html on select object
|
* @param string $htmloption Options html on select object
|
||||||
* @return string HTML string with select
|
* @return string HTML string with select
|
||||||
*/
|
*/
|
||||||
function select_country($selected='',$htmlname='pays_id',$htmloption='')
|
function select_country($selected='',$htmlname='pays_id',$htmloption='')
|
||||||
@ -475,121 +479,16 @@ class Form
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retourne la liste des types de comptes financiers
|
|
||||||
*
|
|
||||||
* @param selected Type pre-selectionne
|
|
||||||
* @param htmlname Nom champ formulaire
|
|
||||||
*/
|
|
||||||
function select_type_comptes_financiers($selected=1,$htmlname='type')
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("banks");
|
|
||||||
|
|
||||||
$type_available=array(0,1,2);
|
|
||||||
|
|
||||||
print '<select class="flat" name="'.$htmlname.'">';
|
|
||||||
$num = count($type_available);
|
|
||||||
$i = 0;
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
if ($selected == $type_available[$i])
|
|
||||||
{
|
|
||||||
print '<option value="'.$type_available[$i].'" selected="selected">'.$langs->trans("BankType".$type_available[$i]).'</option>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<option value="'.$type_available[$i].'">'.$langs->trans("BankType".$type_available[$i]).'</option>';
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print '</select>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return list of social contributions.
|
|
||||||
* Use mysoc->country_id or mysoc->country_code so they must be defined.
|
|
||||||
*
|
|
||||||
* @param selected Preselected type
|
|
||||||
* @param htmlname Name of field in form
|
|
||||||
* @param useempty Set to 1 if we want an empty value
|
|
||||||
* @param maxlen Max length of text in combo box
|
|
||||||
* @param help Add or not the admin help picto
|
|
||||||
*/
|
|
||||||
function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1)
|
|
||||||
{
|
|
||||||
global $db,$langs,$user,$mysoc;
|
|
||||||
|
|
||||||
if (empty($mysoc->country_id) && empty($mysoc->country_code))
|
|
||||||
{
|
|
||||||
dol_print_error('','Call to select_type_socialcontrib with mysoc country not yet defined');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($mysoc->country_id))
|
|
||||||
{
|
|
||||||
$sql = "SELECT c.id, c.libelle as type";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
|
||||||
$sql.= " WHERE c.active = 1";
|
|
||||||
$sql.= " AND c.fk_pays = ".$mysoc->country_id;
|
|
||||||
$sql.= " ORDER BY c.libelle ASC";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$sql = "SELECT c.id, c.libelle as type";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."c_pays as p";
|
|
||||||
$sql.= " WHERE c.active = 1 AND c.fk_pays = p.rowid";
|
|
||||||
$sql.= " AND p.code = '".$mysoc->country_code."'";
|
|
||||||
$sql.= " ORDER BY c.libelle ASC";
|
|
||||||
}
|
|
||||||
|
|
||||||
dol_syslog("Form::select_type_socialcontrib sql=".$sql, LOG_DEBUG);
|
|
||||||
$resql=$db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
print '<select class="flat" name="'.$htmlname.'">';
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
if ($useempty) print '<option value="0"> </option>';
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
print '<option value="'.$obj->id.'"';
|
|
||||||
if ($obj->id == $selected) print ' selected="selected"';
|
|
||||||
print '>'.dol_trunc($obj->type,$maxlen);
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print '</select>';
|
|
||||||
if ($user->admin && $help) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $langs->trans("ErrorNoSocialContributionForSellerCountry",$mysoc->country_code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db,$db->lasterror());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return list of types of lines (product or service)
|
* Return list of types of lines (product or service)
|
||||||
* Example: 0=product, 1=service, 9=other (for external module)
|
* Example: 0=product, 1=service, 9=other (for external module)
|
||||||
*
|
*
|
||||||
* @param selected Preselected type
|
* @param string $selected Preselected type
|
||||||
* @param htmlname Name of field in html form
|
* @param string $htmlname Name of field in html form
|
||||||
* @param showempty Add an empty field
|
* @param int $showempty Add an empty field
|
||||||
* @param hidetext Do not show label before combo box
|
* @param int $hidetext Do not show label before combo box
|
||||||
* @param forceall Force to show products and services in combo list, whatever are activated modules
|
* @param string $forceall Force to show products and services in combo list, whatever are activated modules
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0)
|
function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0)
|
||||||
{
|
{
|
||||||
@ -713,27 +612,13 @@ class Form
|
|||||||
/**
|
/**
|
||||||
* Output html form to select a third party
|
* Output html form to select a third party
|
||||||
*
|
*
|
||||||
* @param selected Preselected type
|
* @param string $selected Preselected type
|
||||||
* @param htmlname Name of field in form
|
* @param string $htmlname Name of field in form
|
||||||
* @param filter Optionnal filters criteras
|
* @param string $filter Optionnal filters criteras
|
||||||
* @param showempty Add an empty field
|
* @param int $showempty Add an empty field
|
||||||
* @param showtype Show third party type in combolist (customer, prospect or supplier)
|
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
|
||||||
* @param forcecombo Force to use combo box
|
* @param int $forcecombo Force to use combo box
|
||||||
*/
|
* @return string HTML string with
|
||||||
function select_societes($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0)
|
|
||||||
{
|
|
||||||
print $this->select_company($selected,$htmlname,$filter,$showempty,$showtype,$forcecombo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Output html form to select a third party
|
|
||||||
*
|
|
||||||
* @param selected Preselected type
|
|
||||||
* @param htmlname Name of field in form
|
|
||||||
* @param filter Optionnal filters criteras
|
|
||||||
* @param showempty Add an empty field
|
|
||||||
* @param showtype Show third party type in combolist (customer, prospect or supplier)
|
|
||||||
* @param forcecombo Force to use combo box
|
|
||||||
*/
|
*/
|
||||||
function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0)
|
function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0)
|
||||||
{
|
{
|
||||||
@ -750,7 +635,7 @@ class Form
|
|||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " ORDER BY nom ASC";
|
$sql.= " ORDER BY nom ASC";
|
||||||
|
|
||||||
dol_syslog("Form::select_societes sql=".$sql);
|
dol_syslog(get_class($this)."::select_company sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -2035,66 +1920,6 @@ class Form
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return combo list of differents status of a proposal
|
|
||||||
* Values are id of table c_propalst
|
|
||||||
*
|
|
||||||
* @param selected etat pre-selectionne
|
|
||||||
* @param short Use short labels
|
|
||||||
*/
|
|
||||||
function select_propal_statut($selected='',$short=0)
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
|
|
||||||
$sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst";
|
|
||||||
$sql .= " WHERE active = 1";
|
|
||||||
|
|
||||||
dol_syslog("Form::select_propal_statut sql=".$sql);
|
|
||||||
$resql=$this->db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
print '<select class="flat" name="propal_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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a HTML select list of bank accounts
|
* Return a HTML select list of bank accounts
|
||||||
*
|
*
|
||||||
@ -2512,10 +2337,10 @@ class Form
|
|||||||
/**
|
/**
|
||||||
* Show a form to select a delivery delay
|
* Show a form to select a delivery delay
|
||||||
*
|
*
|
||||||
* @param page Page
|
* @param int $page Page
|
||||||
* @param selected Id condition pre-selectionne
|
* @param string $selected Id condition pre-selectionne
|
||||||
* @param htmlname Name of select html field
|
* @param string $htmlname Name of select html field
|
||||||
* @param addempty Ajoute entree vide
|
* @param int $addempty Ajoute entree vide
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function form_availability($page, $selected='', $htmlname='availability', $addempty=0)
|
function form_availability($page, $selected='', $htmlname='availability', $addempty=0)
|
||||||
@ -2812,11 +2637,11 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Affiche formulaire de selection des tiers
|
* Output html select to select thirdparty
|
||||||
*
|
*
|
||||||
* @param page Page
|
* @param string $page Page
|
||||||
* @param selected Id contact pre-selectionne
|
* @param string $selected Id preselected
|
||||||
* @param htmlname Nom du formulaire select
|
* @param string $htmlname Name of HTML select
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function form_thirdparty($page, $selected='', $htmlname='socid')
|
function form_thirdparty($page, $selected='', $htmlname='socid')
|
||||||
@ -2830,7 +2655,7 @@ class Form
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
$num=$this->select_societes($selected , $htmlname);
|
print $this->select_company($selected , $htmlname);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||||
print '</tr></table></form>';
|
print '</tr></table></form>';
|
||||||
@ -2843,48 +2668,6 @@ class Form
|
|||||||
$soc = new Societe($this->db);
|
$soc = new Societe($this->db);
|
||||||
$soc->fetch($selected);
|
$soc->fetch($selected);
|
||||||
print $soc->getNomUrl($langs);
|
print $soc->getNomUrl($langs);
|
||||||
} else {
|
|
||||||
print " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show form to select addresse
|
|
||||||
*
|
|
||||||
* @param page Page
|
|
||||||
* @param selected Id condition pre-selectionne
|
|
||||||
* @param htmlname Nom du formulaire select
|
|
||||||
* @param origin Origine de l'appel pour pouvoir creer un retour
|
|
||||||
* @param originid Id de l'origine
|
|
||||||
* @return void
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
function form_address($page, $selected='', $socid, $htmlname='address_id', $origin='', $originid='')
|
|
||||||
{
|
|
||||||
global $langs,$conf;
|
|
||||||
if ($htmlname != "none")
|
|
||||||
{
|
|
||||||
print '<form method="post" action="'.$page.'">';
|
|
||||||
print '<input type="hidden" name="action" value="setaddress">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
|
||||||
print '<tr><td>';
|
|
||||||
$this->select_address($selected, $socid, $htmlname, 1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
|
||||||
$langs->load("companies");
|
|
||||||
print ' <a href='.DOL_URL_ROOT.'/comm/address.php?socid='.$socid.'&action=create&origin='.$origin.'&originid='.$originid.'>'.$langs->trans("AddAddress").'</a>';
|
|
||||||
print '</td></tr></table></form>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($selected)
|
|
||||||
{
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/societe/class/address.class.php");
|
|
||||||
$address=new Address($this->db);
|
|
||||||
$result=$address->fetch_address($selected);
|
|
||||||
print '<a href='.DOL_URL_ROOT.'/comm/address.php?socid='.$address->socid.'&id='.$address->id.'&action=edit&origin='.$origin.'&originid='.$originid.'>'.$address->label.'</a>';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3246,6 +3029,7 @@ class Form
|
|||||||
$base=DOL_URL_ROOT.'/core/';
|
$base=DOL_URL_ROOT.'/core/';
|
||||||
$retstring.=' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\',\''.$langs->defaultlang.'\');">'.img_object($langs->trans("SelectDate"),'calendarday','class="datecallink"').'</button>';
|
$retstring.=' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\',\''.$langs->defaultlang.'\');">'.img_object($langs->trans("SelectDate"),'calendarday','class="datecallink"').'</button>';
|
||||||
}
|
}
|
||||||
|
else $retstring.='<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"),'calendarday','class="datecallink"').'</button>';
|
||||||
|
|
||||||
$retstring.='<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n";
|
$retstring.='<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n";
|
||||||
$retstring.='<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
|
$retstring.='<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
|
||||||
@ -3512,7 +3296,9 @@ class Form
|
|||||||
{
|
{
|
||||||
$newval=($translate?$langs->trans($value):$value);
|
$newval=($translate?$langs->trans($value):$value);
|
||||||
$selectOptionValue = dol_htmlentitiesbr($maxlen?dol_trunc($newval,$maxlen):$newval);
|
$selectOptionValue = dol_htmlentitiesbr($maxlen?dol_trunc($newval,$maxlen):$newval);
|
||||||
if ($value == '' || $value == '-') { $selectOptionValue=' '; }
|
if ($value == '' || $value == '-') {
|
||||||
|
$selectOptionValue=' ';
|
||||||
|
}
|
||||||
$out.=$selectOptionValue;
|
$out.=$selectOptionValue;
|
||||||
}
|
}
|
||||||
$out.="</option>\n";
|
$out.="</option>\n";
|
||||||
@ -3628,21 +3414,21 @@ class Form
|
|||||||
* Return a HTML area with the reference of object and a navigation bar for a business object
|
* Return a HTML area with the reference of object and a navigation bar for a business object
|
||||||
* To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
|
* To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
|
||||||
*
|
*
|
||||||
* @param object Object to show
|
* @param Object $object Object to show
|
||||||
* @param paramid Name of parameter to use to name the id into the URL link
|
* @param int $paramid Name of parameter to use to name the id into the URL link
|
||||||
* @param morehtml More html content to output just before the nav bar
|
* @param string $morehtml More html content to output just before the nav bar
|
||||||
* @param shownav Show Condition (navigation is shown if value is 1)
|
* @param int $shownav Show Condition (navigation is shown if value is 1)
|
||||||
* @param fieldid Nom du champ en base a utiliser pour select next et previous
|
* @param int $fieldid Nom du champ en base a utiliser pour select next et previous
|
||||||
* @param fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous
|
* @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous
|
||||||
* @param morehtmlref Code html supplementaire a afficher apres ref
|
* @param string $morehtmlref Code html supplementaire a afficher apres ref
|
||||||
* @param moreparam More param to add in nav link url.
|
* @param string $moreparam More param to add in nav link url.
|
||||||
* @return string Portion HTML avec ref + boutons nav
|
* @return tring Portion HTML avec ref + boutons nav
|
||||||
*/
|
*/
|
||||||
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='')
|
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='')
|
||||||
{
|
{
|
||||||
$ret='';
|
$ret='';
|
||||||
|
|
||||||
//print "$paramid,$morehtml,$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
|
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
|
||||||
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid);
|
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid);
|
||||||
$previous_ref = $object->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.img_previous().'</a>':'';
|
$previous_ref = $object->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.img_previous().'</a>':'';
|
||||||
$next_ref = $object->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.img_next().'</a>':'';
|
$next_ref = $object->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.img_next().'</a>':'';
|
||||||
@ -3653,14 +3439,17 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ret.=$object->$fieldref;
|
$ret.=$object->$fieldref;
|
||||||
if ($morehtmlref) {
|
if ($morehtmlref)
|
||||||
|
{
|
||||||
$ret.=' '.$morehtmlref;
|
$ret.=' '.$morehtmlref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($morehtml) {
|
if ($morehtml)
|
||||||
|
{
|
||||||
$ret.='</td><td class="nobordernopadding" align="right">'.$morehtml;
|
$ret.='</td><td class="nobordernopadding" align="right">'.$morehtml;
|
||||||
}
|
}
|
||||||
if ($shownav && ($previous_ref || $next_ref)) {
|
if ($shownav && ($previous_ref || $next_ref))
|
||||||
|
{
|
||||||
$ret.='</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td>';
|
$ret.='</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td>';
|
||||||
$ret.='<td class="nobordernopadding" align="center" width="20">'.$next_ref;
|
$ret.='<td class="nobordernopadding" align="center" width="20">'.$next_ref;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user