New: Add option AGENDA_DEFAULT_TYPE

Fix: id is not set on field.
This commit is contained in:
Laurent Destailleur 2014-09-15 17:34:32 +02:00
parent 7fc8799c3d
commit 19e2bd8c90
3 changed files with 5 additions and 9 deletions

View File

@ -616,7 +616,7 @@ if ($action == 'create')
$societe = new Societe($db); $societe = new Societe($db);
$societe->fetch(GETPOST('socid','int')); $societe->fetch(GETPOST('socid','int'));
print $societe->getNomUrl(1); 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 else
{ {

View File

@ -226,7 +226,7 @@ class FormActions
/** /**
* Output list of type of event * 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 $htmlname Nom champ formulaire
* @param string $excludetype Type to exclude * @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) * @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) 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); if (! is_object($form)) $form=new Form($db);
@ -250,6 +250,7 @@ class FormActions
if ($selected == 'manual') $selected='AC_OTH'; if ($selected == 'manual') $selected='AC_OTH';
if ($selected == 'auto') $selected='AC_OTH_AUTO'; 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); print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);

View File

@ -64,7 +64,6 @@ class FormIntervention
$sql = 'SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut'; $sql = 'SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut';
$sql.= ' FROM '.MAIN_DB_PREFIX .'fichinter as f'; $sql.= ' FROM '.MAIN_DB_PREFIX .'fichinter as f';
$sql.= " WHERE f.entity = ".$conf->entity; $sql.= " WHERE f.entity = ".$conf->entity;
//if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")";
if ($socid != '') if ($socid != '')
{ {
if ($socid == '0') $sql.= " AND (f.fk_soc = 0 OR f.fk_soc IS NULL)"; 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); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$out.='<select class="flat" name="'.$htmlname.'">'; $out.='<select id="interventionid" class="flat" name="'.$htmlname.'">';
if ($showempty) $out.='<option value="0">&nbsp;</option>'; if ($showempty) $out.='<option value="0">&nbsp;</option>';
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
@ -92,8 +91,6 @@ class FormIntervention
else else
{ {
$labeltoshow=dol_trunc($obj->ref,18); $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) if (!empty($selected) && $selected == $obj->rowid && $obj->statut > 0)
{ {
$out.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>'; $out.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
@ -120,8 +117,6 @@ class FormIntervention
{ {
$resultat='<option value="'.$obj->rowid.'"'; $resultat='<option value="'.$obj->rowid.'"';
if ($disabled) $resultat.=' disabled="disabled"'; if ($disabled) $resultat.=' disabled="disabled"';
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
$resultat.='>'.$labeltoshow; $resultat.='>'.$labeltoshow;
$resultat.='</option>'; $resultat.='</option>';
} }