Uniformize code

This commit is contained in:
Laurent Destailleur 2011-09-14 23:01:07 +00:00
parent 9b949351ac
commit 1f12ccb9a5
2 changed files with 10 additions and 12 deletions

View File

@ -86,7 +86,7 @@ print '<td>';
$disabled=0; $disabled=0;
$langs->load("companies"); $langs->load("companies");
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
$form->select_societes(GETPOST('socid')?GETPOST('socid'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client=1',!$disabled,$disabled,1); $form->select_societes(GETPOST('socid')?GETPOST('socid'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1);
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />'; //print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -71,11 +71,11 @@ if ($_POST["action"] == 'add' && $user->rights->stock->creer)
} }
$_GET["action"] = 'create'; $_GET["action"] = 'create';
$mesg="<div class='error'>".$entrepot->error."</div>"; $mesg='<div class="error">'.$entrepot->error.'</div>';
} }
else { else {
$mesg="<div class='error'>".$langs->trans("ErrorWarehouseRefRequired")."</div>"; $mesg='<div class="error">'.$langs->trans("ErrorWarehouseRefRequired").'</div>';
$_GET["action"]="create"; // Force retour sur page cr<EFBFBD>ation $_GET["action"]="create"; // Force retour sur page creation
} }
} }
@ -116,7 +116,7 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
{ {
$_GET["action"] = ''; $_GET["action"] = '';
$_GET["id"] = $_POST["id"]; $_GET["id"] = $_POST["id"];
//$mesg = '<div class="ok">Fiche mise <EFBFBD> jour</div>'; //$mesg = '<div class="ok">Fiche mise a jour</div>';
} }
else else
{ {
@ -161,10 +161,7 @@ if ($_GET["action"] == 'create')
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="type" value="'.$type.'">'."\n"; print '<input type="hidden" name="type" value="'.$type.'">'."\n";
if ($mesg) dol_htmloutput_mesg($mesg);
{
print $mesg;
}
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -199,16 +196,17 @@ if ($_GET["action"] == 'create')
print '</select>'; print '</select>';
print '</td></tr>'; print '</td></tr>';
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
print '</table>'; print '</table>';
print '<center><br><input type="submit" class="button" value="'.$langs->trans("Create").'"></center>';
print '</form>'; print '</form>';
} }
else else
{ {
if ($_GET["id"]) if ($_GET["id"])
{ {
if ($mesg) print $mesg; dol_htmloutput_mesg($mesg);
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
$result = $entrepot->fetch($_GET["id"]); $result = $entrepot->fetch($_GET["id"]);