Fix: area to generate doc must use half size not onethird.

Fix: Missing maxwidthonsmartphone.
Fix: Missing backtopage
Fix: Missing translation key
This commit is contained in:
Laurent Destailleur 2014-10-12 11:59:52 +02:00
parent 9768550696
commit f08759a17e
6 changed files with 29 additions and 21 deletions

View File

@ -241,13 +241,20 @@ if (empty($reshook))
$result = $object->delete(); $result = $object->delete();
if ($result > 0) if ($result > 0)
{ {
header("Location: ".DOL_URL_ROOT.'/contact/list.php'); if ($backtopage)
exit; {
header("Location: ".$backtopage);
exit;
}
else
{
header("Location: ".DOL_URL_ROOT.'/contact/list.php');
exit;
}
} }
else else
{ {
setEventMessage($object->error,'errors'); setEventMessage($object->error,$object->errors,'errors');
setEventMessage($object->errors,'errors');
} }
} }
@ -360,7 +367,7 @@ else
{ {
if ($action == 'delete') if ($action == 'delete')
{ {
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id.($backtopage?'&backtopage='.$backtopage:''),$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
} }
} }
@ -1082,27 +1089,27 @@ else
{ {
if ($user->rights->societe->contact->creer) if ($user->rights->societe->contact->creer)
{ {
print '<a class="butAction" href="card.php?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>'; print '<a class="butAction" href="card.php?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
} }
if (! $object->user_id && $user->rights->user->user->creer) if (! $object->user_id && $user->rights->user->user->creer)
{ {
print '<a class="butAction" href="card.php?id='.$object->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>'; print '<a class="butAction" href="card.php?id='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
} }
if ($user->rights->societe->contact->supprimer) if ($user->rights->societe->contact->supprimer)
{ {
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>'; print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete'.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.$langs->trans('Delete').'</a>';
} }
// Activer // Activer
if ($object->statut == 0 && $user->rights->societe->contact->creer) if ($object->statut == 0 && $user->rights->societe->contact->creer)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=enable">'.$langs->trans("Reactivate").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a>';
} }
// Desactiver // Desactiver
if ($object->statut == 1 && $user->rights->societe->contact->creer) if ($object->statut == 1 && $user->rights->societe->contact->creer)
{ {
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&amp;id='.$object->id.'">'.$langs->trans("DisableUser").'</a>'; print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a>';
} }
} }

View File

@ -877,20 +877,21 @@ class Contact extends CommonObject
* @param int $withpicto Include picto with link * @param int $withpicto Include picto with link
* @param string $option Where the link point to * @param string $option Where the link point to
* @param int $maxlen Max length of * @param int $maxlen Max length of
* @param string $moreparam Add more param into URL
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto=0,$option='',$maxlen=0) function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')
{ {
global $langs; global $langs;
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'">';
$lienfin='</a>'; $lienfin='</a>';
if ($option == 'xxx') if ($option == 'xxx')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'">';
$lienfin='</a>'; $lienfin='</a>';
} }

View File

@ -474,14 +474,14 @@ class FormFile
// Model // Model
if (! empty($modellist)) if (! empty($modellist))
{ {
$out.= '<th align="center" class="formdoc liste_titre">'; $out.= '<th align="center" class="formdoc liste_titre maxwidthonsmartphone">';
$out.= '<span class="hideonsmartphone">'.$langs->trans('Model').' </span>'; $out.= '<span class="hideonsmartphone">'.$langs->trans('Model').' </span>';
if (is_array($modellist) && count($modellist) == 1) // If there is only one element if (is_array($modellist) && count($modellist) == 1) // If there is only one element
{ {
$arraykeys=array_keys($modellist); $arraykeys=array_keys($modellist);
$modelselected=$arraykeys[0]; $modelselected=$arraykeys[0];
} }
$out.= $form->selectarray('model',$modellist,$modelselected,$showempty,0,0); $out.= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', '');
$out.= '</th>'; $out.= '</th>';
} }
else else
@ -492,7 +492,7 @@ class FormFile
} }
// Language code (if multilang) // Language code (if multilang)
$out.= '<th align="center" class="formdoc liste_titre">'; $out.= '<th align="center" class="formdoc liste_titre maxwidthonsmartphone">';
if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty)) if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty))
{ {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
@ -508,7 +508,7 @@ class FormFile
// Button // Button
$addcolumforpicto=($delallowed || $printer || $morepicto); $addcolumforpicto=($delallowed || $printer || $morepicto);
$out.= '<th align="center" colspan="'.($addcolumforpicto?'2':'1').'" class="formdocbutton liste_titre">'; $out.= '<th align="center" colspan="'.($addcolumforpicto?'2':'1').'" class="formdocbutton liste_titre maxwidthonsmartphone">';
$genbutton = '<input class="button" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"'; $genbutton = '<input class="button" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"';
$genbutton.= ' type="submit" value="'.$buttonlabel.'"'; $genbutton.= ' type="submit" value="'.$buttonlabel.'"';
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $genbutton.= ' disabled="disabled"'; if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $genbutton.= ' disabled="disabled"';

View File

@ -676,7 +676,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$contactstatic->lastname = $obj->lastname; $contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname; $contactstatic->firstname = $obj->firstname;
$contactstatic->civility_id = $obj->civility_id; $contactstatic->civility_id = $obj->civility_id;
print $contactstatic->getNomUrl(1); print $contactstatic->getNomUrl(1,'',0,'&backtopage='.urlencode($backtopage));
print '</td>'; print '</td>';
print '<td>'.$obj->poste.'</td>'; print '<td>'.$obj->poste.'</td>';

View File

@ -680,7 +680,7 @@ ViewPrivateNote=View notes
XMoreLines=%s line(s) hidden XMoreLines=%s line(s) hidden
PublicUrl=Public URL PublicUrl=Public URL
AddBox=Add box AddBox=Add box
SelectElementAndClickRefresh=Select an element and click Refresh
# Week day # Week day
Monday=Monday Monday=Monday
Tuesday=Tuesday Tuesday=Tuesday

View File

@ -2157,7 +2157,7 @@ else
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC))
{ {
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre print '<a name="builddoc"></a>'; // ancre
/* /*
@ -2172,7 +2172,7 @@ else
$somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang); $somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang);
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
print '</div></div></div>'; print '</div></div></div>';