2
0
forked from Wavyzz/dolibarr

Fix Look and feel v11

This commit is contained in:
Laurent Destailleur
2020-01-28 02:21:39 +01:00
parent fc63d7366d
commit c2c80bf40f
8 changed files with 74 additions and 106 deletions

View File

@@ -193,14 +193,14 @@ $enabledisablehtml .= $langs->trans("EnableDefaultValues").' ';
if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES))
{
// Button off, click to enable
$enabledisablehtml .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=1'.$param.'">';
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=1'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
$enabledisablehtml .= '</a>';
}
else
{
// Button on, click to disable
$enabledisablehtml .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=0'.$param.'">';
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=0'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
$enabledisablehtml .= '</a>';
}

View File

@@ -201,7 +201,7 @@ dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending');
// Shipment numbering model
print load_fiche_titre($langs->trans("SendingsNumberingModules"));
print load_fiche_titre($langs->trans("SendingsNumberingModules"), '', '');
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@@ -304,7 +304,7 @@ print '</table><br>';
/*
* Documents models for Sendings Receipt
*/
print load_fiche_titre($langs->trans("SendingsReceiptModel"));
print load_fiche_titre($langs->trans("SendingsReceiptModel"), '', '');
// Defini tableau def de modele invoice
$type="shipping";
@@ -463,7 +463,7 @@ print '<br>';
* Other options
*
*/
print load_fiche_titre($langs->trans("OtherOptions"));
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@@ -208,14 +208,14 @@ $enabledisablehtml .= $langs->trans("EnableOverwriteTranslation").' ';
if (empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
{
// Button off, click to enable
$enabledisablehtml .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&value=1'.$param.'">';
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&value=1'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
$enabledisablehtml .= '</a>';
}
else
{
// Button on, click to disable
$enabledisablehtml .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&value=0'.$param.'">';
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&value=0'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
$enabledisablehtml .= '</a>';
}

View File

@@ -119,7 +119,7 @@ function shipping_prepare_head($object)
*/
function delivery_prepare_head($object)
{
global $langs, $conf, $user;
global $langs, $db, $conf, $user;
// Load translation files required by the page
$langs->loadLangs(array("sendings","deliveries"));
@@ -140,29 +140,56 @@ function delivery_prepare_head($object)
$head[$h][2] = 'delivery';
$h++;
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->origin_id;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
// complete_head_from_modules use $object->id for this link so we temporary change it
$savObjectId = $object->id;
// Get parent object
$tmpobject = null;
if ($object->origin) {
$tmpobject = new Expedition($db);
$tmpobject->fetch($object->origin_id);
} else {
$tmpobject = $object;
}
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$tmpobject->id;
$head[$h][1] = $langs->trans("ContactsAddresses");
$head[$h][2] = 'contact';
$h++;
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->origin_id;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($tmpobject->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $tmpobject->element, $tmpobject->id);
$head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$tmpobject->id;
$head[$h][1] = $langs->trans('Documents');
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= '<span class="badge marginleftonlyshort">'.($nbFiles+$nbLinks).'</span>';
$head[$h][2] = 'documents';
$h++;
$nbNote = 0;
if (!empty($tmpobject->note_private)) $nbNote++;
if (!empty($tmpobject->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$tmpobject->id;
$head[$h][1] = $langs->trans("Notes");
if ($nbNote > 0) $head[$h][1].= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
$head[$h][2] = 'note';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
// complete_head_from_modules use $object->id for this link so we temporary change it
$tmpObjectId = $object->id;
$object->id = $object->origin_id;
$object->id = $tmpobject->id;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'delivery');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'delivery', 'remove');
$object->id = $tmpObjectId;
$object->id = $savObjectId;
return $head;
}

View File

@@ -211,7 +211,7 @@ if ($id > 0 || !empty($ref))
//print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield">';
// Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled))

View File

@@ -24,7 +24,7 @@
/**
* \file htdocs/livraison/card.php
* \ingroup livraison
* \brief Fiche descriptive d'un bon de livraison=reception
* \brief Page to describe a delivery receipt
*/
require '../main.inc.php';
@@ -247,50 +247,9 @@ $upload_dir = $conf->expedition->dir_output.'/receipt';
$permissiontoadd = $user->rights->expedition->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
/*
* Build document
*/
/*
if ($action == 'builddoc') // En get ou en post
{
// Save last template used to generate document
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$ret=$object->fetch($id); // Reload to get new records
$result= $object->generateDocument($object->modelpdf, $outputlangs);
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
}
// Delete file in doc form
elseif ($action == 'remove_file')
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->expedition->dir_output . "/receipt";
$file = $upload_dir . '/' . GETPOST('file');
$ret=dol_delete_file($file,0,0,0,$object);
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
*/
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
/*
* View
*/
@@ -300,20 +259,10 @@ llxHeader('', $langs->trans('Delivery'), 'Livraison');
$form = new Form($db);
$formfile = new FormFile($db);
/*********************************************************************
*
* Mode creation
*
*********************************************************************/
if ($action == 'create') // Seems to no be used
if ($action == 'create') // Create. Seems to no be used
{
}
else
/* *************************************************************************** */
/* */
/* Mode vue et edition */
/* */
/* *************************************************************************** */
else // View
{
if ($object->id > 0)
{

View File

@@ -838,8 +838,8 @@ class Livraison extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
* @param int $status Id status
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
public function LibStatut($status, $mode)
@@ -847,36 +847,23 @@ class Livraison extends CommonObject
// phpcs:enable
global $langs;
if ($mode==0)
if (empty($this->labelStatus) || empty($this->labelStatusShort))
{
if ($status==-1) return $langs->trans('StatusDeliveryCanceled');
elseif ($status==0) return $langs->trans('StatusDeliveryDraft');
elseif ($status==1) return $langs->trans('StatusDeliveryValidated');
}
elseif ($mode==1)
{
if ($status==-1) return $langs->trans($this->statuts[$status]);
elseif ($status==0) return $langs->trans($this->statuts[$status]);
elseif ($status==1) return $langs->trans($this->statuts[$status]);
}
elseif ($mode == 3)
{
if ($status==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5');
if ($status==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0');
if ($status==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4');
}
elseif ($mode == 4)
{
if ($status==-1) return img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5').' '.$langs->trans('StatusDeliveryCanceled');
elseif ($status==0) return img_picto($langs->trans('StatusDeliveryDraft'), 'statut0').' '.$langs->trans('StatusDeliveryDraft');
elseif ($status==1) return img_picto($langs->trans('StatusDeliveryValidated'), 'statut4').' '.$langs->trans('StatusDeliveryValidated');
}
elseif ($mode == 6)
{
if ($status==-1) return $langs->trans('StatusDeliveryCanceled').' '.img_picto($langs->trans('StatusDeliveryCanceled'), 'statut5');
elseif ($status==0) return $langs->trans('StatusDeliveryDraft').' '.img_picto($langs->trans('StatusDeliveryDraft'), 'statut0');
elseif ($status==1) return $langs->trans('StatusDeliveryValidated').' '.img_picto($langs->trans('StatusDeliveryValidated'), 'statut4');
global $langs;
//$langs->load("mymodule");
$this->labelStatus[-1] = $langs->trans('StatusDeliveryCanceled');
$this->labelStatus[0] = $langs->trans('StatusDeliveryDraft');
$this->labelStatus[1] = $langs->trans('StatusDeliveryValidated');
$this->labelStatusShort[-1] = $langs->trans('StatusDeliveryCanceled');
$this->labelStatusShort[0] = $langs->trans('StatusDeliveryDraft');
$this->labelStatusShort[1] = $langs->trans('StatusDeliveryValidated');
}
$statusType = 'status0';
if ($status == -1) $statusType = 'status5';
if ($status == 1) $statusType = 'status4';
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
}

View File

@@ -2377,9 +2377,14 @@ div.tabs {
div.tabsElem {
margin-top: 1px;
} /* To avoid overlap of tabs when not browser */
div.tabsElem a {
/* font-weight: normal !important; */
/*
div.tabsElem a.tabactive::before, div.tabsElem a.tabunactive::before {
content: "\f0da";
font-family: "Font Awesome 5 Free";
padding-right: 2px;
font-weight: 900;
}
*/
div.tabBar {
color: #<?php echo $colortextbacktab; ?>;
padding-top: 16px;