Skip to content

Commit

Permalink
New: Add hidden option MAIN_FORCE_DEFAULT_STATE_ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 11, 2013
1 parent 303cad1 commit 559b75c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Expand Up @@ -61,7 +61,8 @@ For users:
- New: Can send an email from thirdparty card.
- New: Can cancel holidays that were previously validated.
- Fix: [bug #1022] correct margin calculation for credit notes.
- New: Can choose contact on event (action com) creation, and filtred by thirdparty
- New: Can choose contact on event (action com) creation, and filtred by thirdparty.
- New: Add hidden option MAIN_FORCE_DEFAULT_STATE_ID.

For translators:
- Qual: Normalized sort order of all languages files with english reference files.
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/class/html.formcompany.class.php
Expand Up @@ -203,7 +203,7 @@ function select_departement($selected='',$country_codeid=0, $htmlname='state_id'
* un code donnee mais dans ce cas, le champ pays differe).
* Ainsi les liens avec les departements se font sur un departement independemment de son nom.
*
* @param string $selected Code state preselected
* @param string $selected Code state preselected (mus be state id)
* @param string $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
* @param string $htmlname Id of department
* @return string String with HTML select
Expand Down Expand Up @@ -257,7 +257,8 @@ function select_state($selected='',$country_codeid=0, $htmlname='state_id')
}
}

if ($selected > 0 && $selected == $obj->rowid)
if ((! empty($selected) && $selected == $obj->rowid)
|| (empty($selected) && ! empty($conf->global->MAIN_FORCE_DEFAULT_STATE_ID) && $conf->global->MAIN_FORCE_DEFAULT_STATE_ID == $obj->rowid))
{
$out.= '<option value="'.$obj->rowid.'" selected="selected">';
}
Expand Down

0 comments on commit 559b75c

Please sign in to comment.