Merge pull request #2852 from aspangaro/develop-resource

NEW Forms are using the tab look, even in creation mode
This commit is contained in:
Laurent Destailleur 2015-05-20 15:27:08 +02:00
commit f0cfa3406c
5 changed files with 45 additions and 31 deletions

View File

@ -1,6 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -128,7 +128,6 @@ else if ($action == 'delete')
/* /*
* View * View
*
*/ */
llxheader('', $langs->trans('AccountAccounting')); llxheader('', $langs->trans('AccountAccounting'));
@ -143,6 +142,8 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>'; print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
@ -164,7 +165,9 @@ if ($action == 'create')
print '</table>'; print '</table>';
print '<br><div class="center">'; dol_fiche_end();
print '<div class="center">';
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">'; print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">'; print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
@ -217,15 +220,15 @@ else if ($id)
print '</table>'; print '</table>';
print '<br><div class="center">'; dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">'; print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans("Cancel") . '">'; print '<input type="submit" name="cancel" class="button" value="' . $langs->trans("Cancel") . '">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';
print '</div>';
} }
else else
{ {
@ -269,7 +272,7 @@ else if ($id)
print '</table>'; print '</table>';
print '</div>'; dol_fiche_end();
/* /*
* Barre d'actions * Barre d'actions
@ -297,6 +300,6 @@ else if ($id)
dol_print_error($db); dol_print_error($db);
} }
} }
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -176,6 +176,8 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Label // Label
@ -200,7 +202,9 @@ if ($action == 'create')
print '</table>'; print '</table>';
print '<br><div class="center">'; dol_fiche_end();
print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -187,6 +188,8 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewVATPayment")); print_fiche_titre($langs->trans("NewVATPayment"));
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print "<tr>"; print "<tr>";
@ -228,7 +231,7 @@ if ($action == 'create')
print '</table>'; print '</table>';
print "<br>"; dol_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -191,6 +191,8 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
dol_fiche_head();
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Label // Label
@ -287,8 +289,10 @@ if ($action == 'create')
print '</table>'; print '</table>';
print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; '; dol_fiche_end();
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
print '<div align="center"><input class="button" type="submit" value="'.$langs->trans("Save").'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print '</form>'; print '</form>';
} }

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr> /* Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -22,15 +23,10 @@
* Initialy built by build_class_from_table on 2013-07-24 16:03 * Initialy built by build_class_from_table on 2013-07-24 16:03
*/ */
require '../main.inc.php';
// Change this following line to use the correct relative path (../, ../../, etc) require_once DOL_DOCUMENT_ROOT.'/resource/class/resource.class.php';
$res=0; require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
$res=@include("../main.inc.php"); // For root directory
if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory
if (! $res) die("Include of main fails");
require_once 'class/resource.class.php';
require_once 'class/html.formresource.class.php';
// Load traductions files required by page // Load traductions files required by page
$langs->load("resource"); $langs->load("resource");
@ -132,6 +128,8 @@ if (! $action)
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="add_resource">'; print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="add_resource">';
print '<input type="hidden" name="action" value="confirm_add_resource" />'; print '<input type="hidden" name="action" value="confirm_add_resource" />';
dol_fiche_head('');
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref / label // Ref / label
@ -161,7 +159,7 @@ if (! $action)
print '</label>'; print '</label>';
print '</td>'; print '</td>';
print '<td>'; print '<td>';
require_once (DOL_DOCUMENT_ROOT . "/core/class/doleditor.class.php"); require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($field, $$field, 160, '', '', false); $doleditor = new DolEditor($field, $$field, 160, '', '', false);
$doleditor->Create(); $doleditor->Create();
print '</td>'; print '</td>';
@ -169,9 +167,11 @@ if (! $action)
print '</table>'; print '</table>';
echo '<br><div align="center">', dol_fiche_end('');
echo '<div align="center">',
'<input type="submit" class="button" name="add" value="'.$langs->trans('Save').'" />', '<input type="submit" class="button" name="add" value="'.$langs->trans('Save').'" />',
'&nbsp;', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
'<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'" />', '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'" />',
'</div>'; '</div>';