Highlight of required fields should be only in edit mode

Conflicts:
	htdocs/bookmarks/card.php
This commit is contained in:
Marcos García de La Fuente 2014-11-24 01:05:01 +01:00 committed by Laurent Destailleur
parent 6159591a02
commit 601710a4dc

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@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
@ -213,12 +214,31 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
print '<tr><td>'.$langs->trans("BookmarkTitle").'</td><td>'; print '<tr><td>';
if ($action == 'edit') {
print '<span class="fieldrequired">';
}
print $langs->trans("BookmarkTitle");
if ($action == 'edit') {
print '</span>';
}
print '</td><td>';
if ($action == 'edit') print '<input class="flat" name="title" size="30" value="'.(isset($_POST["title"])?$_POST["title"]:$bookmark->title).'">'; if ($action == 'edit') print '<input class="flat" name="title" size="30" value="'.(isset($_POST["title"])?$_POST["title"]:$bookmark->title).'">';
else print $bookmark->title; else print $bookmark->title;
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("UrlOrLink").'</td><td>'; print '<tr><td>';
if ($action == 'edit') {
print '<span class="fieldrequired">';
}
print $langs->trans("UrlOrLink");
if ($action == 'edit') {
print '</span>';
}
print '</td><td>';
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">'; if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>'; else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>';
print '</td></tr>'; print '</td></tr>';