Skip to content
Snippets Groups Projects
Commit 19e2bd8c authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Add option AGENDA_DEFAULT_TYPE

Fix: id is not set on field.
parent 7fc8799c
No related branches found
No related tags found
No related merge requests found
......@@ -616,7 +616,7 @@ if ($action == 'create')
$societe = new Societe($db);
$societe->fetch(GETPOST('socid','int'));
print $societe->getNomUrl(1);
print '<input type="hidden" name="socid" value="'.GETPOST('socid','int').'">';
print '<input type="hidden" id="socid" name="socid" value="'.GETPOST('socid','int').'">';
}
else
{
......
......@@ -226,7 +226,7 @@ class FormActions
/**
* Output list of type of event
*
* @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'
* @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx')
* @param string $htmlname Nom champ formulaire
* @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
......@@ -235,7 +235,7 @@ class FormActions
*/
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0)
{
global $langs,$user,$form;
global $langs,$user,$form,$conf;
if (! is_object($form)) $form=new Form($db);
......@@ -250,6 +250,7 @@ class FormActions
if ($selected == 'manual') $selected='AC_OTH';
if ($selected == 'auto') $selected='AC_OTH_AUTO';
if (empty($selected) && ! empty($conf->global->AGENDA_DEFAULT_TYPE)) $selected=$conf->global->AGENDA_DEFAULT_TYPE;
print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
......
......@@ -64,7 +64,6 @@ class FormIntervention
$sql = 'SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut';
$sql.= ' FROM '.MAIN_DB_PREFIX .'fichinter as f';
$sql.= " WHERE f.entity = ".$conf->entity;
//if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")";
if ($socid != '')
{
if ($socid == '0') $sql.= " AND (f.fk_soc = 0 OR f.fk_soc IS NULL)";
......@@ -75,7 +74,7 @@ class FormIntervention
$resql=$db->query($sql);
if ($resql)
{
$out.='<select class="flat" name="'.$htmlname.'">';
$out.='<select id="interventionid" class="flat" name="'.$htmlname.'">';
if ($showempty) $out.='<option value="0">&nbsp;</option>';
$num = $db->num_rows($resql);
$i = 0;
......@@ -92,8 +91,6 @@ class FormIntervention
else
{
$labeltoshow=dol_trunc($obj->ref,18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
if (!empty($selected) && $selected == $obj->rowid && $obj->statut > 0)
{
$out.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
......@@ -120,8 +117,6 @@ class FormIntervention
{
$resultat='<option value="'.$obj->rowid.'"';
if ($disabled) $resultat.=' disabled="disabled"';
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
$resultat.='>'.$labeltoshow;
$resultat.='</option>';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment