Clean code
This commit is contained in:
parent
d16276ea2c
commit
6f25f7c2cb
@ -4365,14 +4365,11 @@ class Form
|
|||||||
$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
|
$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
|
||||||
$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
|
$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
|
||||||
|
|
||||||
if ($input['type'] == 'text')
|
if ($input['type'] == 'text') {
|
||||||
{
|
|
||||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
||||||
} elseif ($input['type'] == 'password')
|
} elseif ($input['type'] == 'password') {
|
||||||
{
|
|
||||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
||||||
} elseif ($input['type'] == 'select')
|
} elseif ($input['type'] == 'select') {
|
||||||
{
|
|
||||||
if (empty($morecss)) {
|
if (empty($morecss)) {
|
||||||
$morecss = 'minwidth100';
|
$morecss = 'minwidth100';
|
||||||
}
|
}
|
||||||
@ -4380,8 +4377,7 @@ class Form
|
|||||||
if (!empty($input['label'])) $more .= $input['label'].'</div><div class="tagtd left">';
|
if (!empty($input['label'])) $more .= $input['label'].'</div><div class="tagtd left">';
|
||||||
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss);
|
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss);
|
||||||
$more .= '</div></div>'."\n";
|
$more .= '</div></div>'."\n";
|
||||||
} elseif ($input['type'] == 'checkbox')
|
} elseif ($input['type'] == 'checkbox') {
|
||||||
{
|
|
||||||
$more .= '<div class="tagtr">';
|
$more .= '<div class="tagtr">';
|
||||||
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
|
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
|
||||||
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$moreattr;
|
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$moreattr;
|
||||||
@ -4390,8 +4386,7 @@ class Form
|
|||||||
if (isset($input['disabled'])) $more .= ' disabled';
|
if (isset($input['disabled'])) $more .= ' disabled';
|
||||||
$more .= ' /></div>';
|
$more .= ' /></div>';
|
||||||
$more .= '</div>'."\n";
|
$more .= '</div>'."\n";
|
||||||
} elseif ($input['type'] == 'radio')
|
} elseif ($input['type'] == 'radio') {
|
||||||
{
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($input['values'] as $selkey => $selval)
|
foreach ($input['values'] as $selkey => $selval)
|
||||||
{
|
{
|
||||||
@ -4406,8 +4401,7 @@ class Form
|
|||||||
$more .= '</div></div>'."\n";
|
$more .= '</div></div>'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} elseif ($input['type'] == 'date')
|
} elseif ($input['type'] == 'date') {
|
||||||
{
|
|
||||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
|
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
|
||||||
$more .= '<div class="tagtd">';
|
$more .= '<div class="tagtd">';
|
||||||
$more .= $this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, 0);
|
$more .= $this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, 0);
|
||||||
@ -4417,17 +4411,17 @@ class Form
|
|||||||
$formquestion[] = array('name'=>$input['name'].'year');
|
$formquestion[] = array('name'=>$input['name'].'year');
|
||||||
$formquestion[] = array('name'=>$input['name'].'hour');
|
$formquestion[] = array('name'=>$input['name'].'hour');
|
||||||
$formquestion[] = array('name'=>$input['name'].'min');
|
$formquestion[] = array('name'=>$input['name'].'min');
|
||||||
} elseif ($input['type'] == 'other')
|
} elseif ($input['type'] == 'other') {
|
||||||
{
|
|
||||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
|
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
|
||||||
if (!empty($input['label'])) $more .= $input['label'].'</div><div class="tagtd">';
|
if (!empty($input['label'])) $more .= $input['label'].'</div><div class="tagtd">';
|
||||||
$more .= $input['value'];
|
$more .= $input['value'];
|
||||||
$more .= '</div></div>'."\n";
|
$more .= '</div></div>'."\n";
|
||||||
} elseif ($input['type'] == 'onecolumn')
|
} elseif ($input['type'] == 'onecolumn') {
|
||||||
{
|
|
||||||
$moreonecolumn .= '<div class="margintoponly">';
|
$moreonecolumn .= '<div class="margintoponly">';
|
||||||
$moreonecolumn .= $input['value'];
|
$moreonecolumn .= $input['value'];
|
||||||
$moreonecolumn .= '</div>'."\n";
|
$moreonecolumn .= '</div>'."\n";
|
||||||
|
} elseif ($input['type'] == 'hidden') {
|
||||||
|
// Do nothing more, already added by a previous loop
|
||||||
} else {
|
} else {
|
||||||
$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
|
$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8206,7 +8206,7 @@ function showDirectDownloadLink($object)
|
|||||||
|
|
||||||
if ($url)
|
if ($url)
|
||||||
{
|
{
|
||||||
$out .= img_picto('', 'globe').' '.$langs->trans("DirectDownloadLink").'<br>';
|
$out .= img_picto($langs->trans("PublicDownloadLinkdesc"), 'globe').' '.$langs->trans("DirectDownloadLink").'<br>';
|
||||||
$out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'">';
|
$out .= '<input type="text" id="directdownloadlink" class="quatrevingtpercent" value="'.$url.'">';
|
||||||
$out .= ajax_autoselect("directdownloadlink", 0);
|
$out .= ajax_autoselect("directdownloadlink", 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -290,7 +290,7 @@ print '<div class="fichecenter">';
|
|||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border centpercent tableforfield">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("ECMCreationDate").'</td><td>';
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("ECMCreationDate").'</td><td>';
|
||||||
print dol_print_date(dol_filemtime($fullpath), 'dayhour');
|
print dol_print_date(dol_filemtime($fullpath), 'dayhour');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
/*print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
|
/*print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
|
||||||
@ -321,7 +321,9 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
|
|||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
// Link for internal download
|
// Link for internal download
|
||||||
print '<tr><td>'.$langs->trans("DirectDownloadInternalLink").'</td><td>';
|
print '<tr><td>';
|
||||||
|
print $form->textwithpicto($langs->trans("DirectDownloadInternalLink"), $langs->trans("PrivateDownloadLinkDesc"));
|
||||||
|
print '</td><td>';
|
||||||
$modulepart = 'ecm';
|
$modulepart = 'ecm';
|
||||||
$forcedownload = 1;
|
$forcedownload = 1;
|
||||||
$rellink = '/document.php?modulepart='.$modulepart;
|
$rellink = '/document.php?modulepart='.$modulepart;
|
||||||
@ -347,9 +349,9 @@ print '</td></tr>';
|
|||||||
// Link for direct external download
|
// Link for direct external download
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
if ($action != 'edit') {
|
if ($action != 'edit') {
|
||||||
print $langs->trans("DirectDownloadLink");
|
print $form->textwithpicto($langs->trans("DirectDownloadLink"), $langs->trans("PublicDownloadLinkDesc"));
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("FileSharedViaALink");
|
print $form->textwithpicto($langs->trans("FileSharedViaALink"), $langs->trans("PublicDownloadLinkDesc"));
|
||||||
}
|
}
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if (!empty($object->share)) {
|
if (!empty($object->share)) {
|
||||||
|
|||||||
@ -899,8 +899,10 @@ ViewAccountList=View ledger
|
|||||||
ViewSubAccountList=View subaccount ledger
|
ViewSubAccountList=View subaccount ledger
|
||||||
RemoveString=Remove string '%s'
|
RemoveString=Remove string '%s'
|
||||||
SomeTranslationAreUncomplete=Some of the languages offered may be only partially translated or may contain errors. Please help to correct your language by registering at <a href="https://transifex.com/projects/p/dolibarr/" target="_blank">https://transifex.com/projects/p/dolibarr/</a> to add your improvements.
|
SomeTranslationAreUncomplete=Some of the languages offered may be only partially translated or may contain errors. Please help to correct your language by registering at <a href="https://transifex.com/projects/p/dolibarr/" target="_blank">https://transifex.com/projects/p/dolibarr/</a> to add your improvements.
|
||||||
DirectDownloadLink=Direct download link (public/external)
|
DirectDownloadLink=Public download link
|
||||||
DirectDownloadInternalLink=Direct download link (need to be logged and need permissions)
|
PublicDownloadLinkDesc=Only the link is required to download the file
|
||||||
|
DirectDownloadInternalLink=Private download link
|
||||||
|
PrivateDownloadLinkDesc=You need to be logged and you need permissions to view or download the file
|
||||||
Download=Download
|
Download=Download
|
||||||
DownloadDocument=Download document
|
DownloadDocument=Download document
|
||||||
ActualizeCurrency=Update currency rate
|
ActualizeCurrency=Update currency rate
|
||||||
@ -1049,7 +1051,7 @@ KeyboardShortcut=Keyboard shortcut
|
|||||||
AssignedTo=Assigned to
|
AssignedTo=Assigned to
|
||||||
Deletedraft=Delete draft
|
Deletedraft=Delete draft
|
||||||
ConfirmMassDraftDeletion=Draft mass delete confirmation
|
ConfirmMassDraftDeletion=Draft mass delete confirmation
|
||||||
FileSharedViaALink=File shared via a link
|
FileSharedViaALink=File shared with a public link
|
||||||
SelectAThirdPartyFirst=Select a third party first...
|
SelectAThirdPartyFirst=Select a third party first...
|
||||||
YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
|
YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
|
||||||
Inventory=Inventory
|
Inventory=Inventory
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user