From b5b0eba4700b7f7d9ad012de1ac0a26157efc0f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Mar 2017 12:47:48 +0200 Subject: [PATCH] Several enhancement for 6.0 --- htdocs/contrat/card.php | 10 +- htdocs/contrat/class/contrat.class.php | 19 +- htdocs/contrat/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/core/boxes/box_contracts.php | 8 +- htdocs/core/boxes/modules_boxes.php | 4 +- htdocs/core/lib/fichinter.lib.php | 8 - htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 4 +- htdocs/fichinter/apercu.php | 197 ------------------- htdocs/fichinter/card.php | 2 +- htdocs/fichinter/contact.php | 2 +- htdocs/fichinter/document.php | 2 +- htdocs/fichinter/info.php | 2 +- htdocs/fichinter/note.php | 2 +- htdocs/index.php | 1 + htdocs/main.inc.php | 6 +- htdocs/resource/element_resource.php | 6 +- htdocs/theme/eldy/style.css.php | 24 ++- 18 files changed, 59 insertions(+), 242 deletions(-) delete mode 100644 htdocs/fichinter/apercu.php diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 400548b7076..34f44c4f690 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1271,7 +1271,7 @@ else $hselected = 0; - dol_fiche_head($head, $hselected, $langs->trans("Contract"), 0, 'contract'); + dol_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); /* @@ -1595,7 +1595,7 @@ else print "\n"; - // Dates de en service prevues et effectives + // Dates of service planed and real if ($objp->subprice >= 0) { $colspan = 6; @@ -1862,15 +1862,13 @@ else print ''; } + // Form to activate line if ($user->rights->contrat->activer && $action == 'activateline' && $object->lines[$cursorline-1]->id == GETPOST('ligne')) { - /** - * Activer la ligne de contrat - */ print '
'; print ''; - print ''; + print '
'; // Definie date debut et fin par defaut $dateactstart = $objp->date_debut; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index ca751a5892a..d4d41b2f60c 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1765,7 +1765,7 @@ class Contrat extends CommonObject /** * Return label of a contract status * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length * @return string Label */ function getLibStatut($mode) @@ -1777,7 +1777,7 @@ class Contrat extends CommonObject * Renvoi label of a given contrat status * * @param int $statut Status id - * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services + * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length * @return string Label */ function LibStatut($statut,$mode) @@ -1808,7 +1808,7 @@ class Contrat extends CommonObject if ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'),'statut4'); } if ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'),'statut6'); } } - if ($mode == 4 || $mode == 6) + if ($mode == 4 || $mode == 6 || $mode == 7) { $line=new ContratLigne($this->db); $text=''; @@ -1818,10 +1818,15 @@ class Contrat extends CommonObject $text.=' '.$langs->trans("Services"); $text.=':     '; } - $text.=$this->nbofserviceswait.' '.$line->LibStatut(0,3).'   '; - $text.=$this->nbofservicesopened.' '.$line->LibStatut(4,3,0).'   '; - $text.=$this->nbofservicesexpired.' '.$line->LibStatut(4,3,1).'   '; - $text.=$this->nbofservicesclosed.' '.$line->LibStatut(5,3); + $text.=($mode == 7?'
':''); + $text.=($mode != 7 || $this->nbofserviceswait > 0) ? $this->nbofserviceswait.' '.$line->LibStatut(0,3).'   ' : ''; + $text.=($mode == 7?'
':''); + $text.=($mode != 7 || $this->nbofservicesopened > 0) ? $this->nbofservicesopened.' '.$line->LibStatut(4,3,0).'   ' : ''; + $text.=($mode == 7?'
':''); + $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? $this->nbofservicesexpired.' '.$line->LibStatut(4,3,1).'   ' : ''; + $text.=($mode == 7?'
':''); + $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? $this->nbofservicesclosed.' '.$line->LibStatut(5,3).'   ' : ''; + $text.=($mode == 7?'
':''); return $text; } if ($mode == 5) diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index 9ea21f890fc..1257e3503a9 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -43,7 +43,7 @@ foreach($linkedObjectBlock as $key => $objectlink) - + diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index cd436f3eb85..7585c5d931c 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -1,7 +1,7 @@ - * Copyright (C) 2015 Frederic France - * Copyright (C) 2016 Laurent Destailleur +/* Copyright (C) 2010 Regis Houssin + * Copyright (C) 2015 Frederic France + * Copyright (C) 2016-2017 Laurent Destailleur * * 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 @@ -125,7 +125,7 @@ class box_contracts extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="nowrap right"', - 'text' => $contractstatic->getLibStatut(6), + 'text' => $contractstatic->getLibStatut(7), 'asis'=>1, ); diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 3ebac7e7ab0..26ee34bdca0 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -325,13 +325,13 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; if ($maxlength) $textwithnotags=dol_trunc($textwithnotags,$maxlength); - if (preg_match('/^global->MAIN_USE_PREVIEW_TABS)) - { - $head[$h][0] = DOL_URL_ROOT.'/fichinter/apercu.php?id='.$object->id; - $head[$h][1] = $langs->trans('Preview'); - $head[$h][2] = 'preview'; - $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 diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 51be81a7bd5..1cb4da03488 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1626,7 +1626,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->commande->dir_output.'/'.$original_file; } // Wrapping pour les apercu intervention - elseif ($modulepart == 'apercufichinter' && !empty($conf->ficheinter->dir_output)) + elseif (($modulepart == 'apercufichinter' || $modulepart == 'apercuficheinter') && !empty($conf->ficheinter->dir_output)) { if ($fuser->rights->ficheinter->lire) $accessallowed=1; $original_file=$conf->ficheinter->dir_output.'/'.$original_file; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 06419ba5930..20186ebe28d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1014,6 +1014,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element == 'propal') $modulepart='propal'; if ($object->element == 'commande') $modulepart='commande'; if ($object->element == 'facture') $modulepart='facture'; + if ($object->element == 'fichinter') $modulepart='ficheinter'; if ($object->element == 'product') { @@ -1041,7 +1042,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($modulepart != 'unknown') { // Check if a preview file is available - if (in_array($modulepart, array('propal', 'commande', 'facture')) && class_exists("Imagick")) + if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter')) && class_exists("Imagick")) { $objectref = dol_sanitizeFileName($object->ref); $dir_output = $conf->$modulepart->dir_output . "/"; @@ -2694,6 +2695,7 @@ function img_warning($titlealt = 'default', $morealt = '') if ($titlealt == 'default') $titlealt = $langs->trans('Warning'); + //return '
'.img_picto($titlealt, 'warning_white.png', 'class="pictowarning valignmiddle"'.($morealt ? ($morealt == '1' ? ' style="float: right"' : ' '.$morealt): '')).'
'; return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"'.($morealt ? ($morealt == '1' ? ' style="float: right"' : ' '.$morealt): '')); } diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php deleted file mode 100644 index 899ecaf9805..00000000000 --- a/htdocs/fichinter/apercu.php +++ /dev/null @@ -1,197 +0,0 @@ - - * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/fichinter/apercu.php - * \ingroup fichinter - * \brief Page de l'onglet apercu d'une fiche d'intervention - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - -$langs->load('interventions'); - - -// Security check -$socid=0; -$id = GETPOST('id','int'); -$ref = GETPOST('ref','alpha'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); - - -/* - * View - */ - -llxHeader(); - -$form = new Form($db); - -/* *************************************************************************** */ -/* */ -/* Mode fiche */ -/* */ -/* *************************************************************************** */ - -if ($id > 0 || ! empty($ref)) -{ - $object = new Fichinter($db); - - if ($object->fetch($id,$ref) > 0) - { - $soc = new Societe($db); - $soc->fetch($object->socid); - - $head = fichinter_prepare_head($object); - dol_fiche_head($head, 'preview', $langs->trans("InterventionCard"), 0, 'intervention'); - - /* - * Fiche intervention - */ - print '
date_contrat,'day'); ?>  getLibStatut(6); ?>getLibStatut(7); ?> ">transnoentitiesnoconv("RemoveLink")); ?>
'; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - $nbrow=3; - // Client - print ""; - print ''; - print '"; - - // Statut - print ''; - print "\n"; - print ''; - - // Date - print ''; - print "\n"; - print ''; - - print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '
".$langs->trans("Customer")."'; - print ''.$soc->name.''; - print ''; - - /* - * Documents - */ - $objectref = dol_sanitizeFileName($object->ref); - $dir_output = $conf->ficheinter->dir_output . "/"; - $filepath = $dir_output . $objectref . "/"; - $file = $filepath . $objectref . ".pdf"; - $filedetail = $filepath . $objectref . "-detail.pdf"; - $relativepath = "${objectref}/${objectref}.pdf"; - $relativepathdetail = "${objectref}/${objectref}-detail.pdf"; - - // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") - $fileimage = $file.'_preview.png'; // If PDF has 1 page - $fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page - $relativepathimage = $relativepath.'_preview.png'; - - $var=true; - - // Si fichier PDF existe - if (file_exists($file)) - { - $encfile = urlencode($file); - print load_fiche_titre($langs->trans("Documents")); - print ''; - - print ""; - - print ''; - print ''; - print ''; - print ''; - - // Si fichier detail PDF existe - if (file_exists($filedetail)) - { - print ""; - - print ''; - print ''; - print ''; - print ''; - } - print "
".$langs->trans("Intervention")." PDF'.$object->ref.'.pdf'.dol_print_size(dol_filesize($file)).''.dol_print_date(dol_filemtime($file),'dayhour').'
Fiche d'intervention detaillee'.$object->ref.'-detail.pdf'.dol_print_size(dol_filesize($filedetail)).''.dol_print_date(dol_filemtime($filedetail),'dayhour').'
\n"; - - // Conversion du PDF en image png si fichier png non existant - if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file))) - { - if (class_exists("Imagick")) - { - $ret = dol_convert_file($file,'png',$fileimage); - if ($ret < 0) $error++; - } - else - { - $langs->load("errors"); - print ''.$langs->trans("ErrorNoImagickReadimage").''; - } - } - } - - print "
'.$langs->trans("Status").'".$object->getLibStatut(4)."
'.$langs->trans("Date").'".dol_print_date($object->datec,"daytext")."
'; - - dol_fiche_end(); - } - else - { - // Object not found - print $langs->trans("ErrorFichinterNotFound",$id); - } -} - -// Si fichier png PDF d'1 page trouve -if (file_exists($fileimage)) -{ - print ''; -} -// Si fichier png PDF de plus d'1 page trouve -elseif (file_exists($fileimagebis)) -{ - $multiple = $relativepath . "-"; - - for ($i = 0; $i < 20; $i++) - { - $preview = $multiple.$i.'.png'; - - if (file_exists($dir_output.$preview)) - { - print '

'; - } - } -} - - -llxFooter(); - -$db->close(); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 31f72e18075..cd10e704d90 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1079,7 +1079,7 @@ else if ($id > 0 || ! empty($ref)) $head = fichinter_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("InterventionCard"), 0, 'intervention'); + dol_fiche_head($head, 'card', $langs->trans("InterventionCard"), -1, 'intervention'); $formconfirm=''; diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index 83825b08a90..2b40553a3d9 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -122,7 +122,7 @@ if ($id > 0 || ! empty($ref)) $object->fetch_thirdparty(); $head = fichinter_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("InterventionCard"), 0, 'intervention'); + dol_fiche_head($head, 'contact', $langs->trans("InterventionCard"), -1, 'intervention'); // Intervention card diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 2e53d6ebc62..f24283e8aa1 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -89,7 +89,7 @@ if ($object->id) $head=fichinter_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("InterventionCard"), 0, 'intervention'); + dol_fiche_head($head, 'documents', $langs->trans("InterventionCard"), -1, 'intervention'); // Construit liste des fichiers diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index de2317eecca..87533644893 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -58,7 +58,7 @@ $object->fetch_thirdparty(); $object->info($object->id); $head = fichinter_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans('InterventionCard'), 0, 'intervention'); +dol_fiche_head($head, 'info', $langs->trans('InterventionCard'), -1, 'intervention'); // Intervention card $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index 1da0b0c425c..43a2654d1fd 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -63,7 +63,7 @@ if ($id > 0 || ! empty($ref)) $object->fetch_thirdparty(); $head = fichinter_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), 0, 'intervention'); + dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), -1, 'intervention'); // Intervention card $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/index.php b/htdocs/index.php index 29f80428b11..e0609c91274 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -568,6 +568,7 @@ if (! empty($valid_dashboardlines)) { $boxwork .= '

'; $boxwork .= ''; + //$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"').''; $boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"').''; $boxwork .= ''; $boxwork .= $board->nbtodolate; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7d5e5dfa64c..8d1138e5758 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -848,9 +848,9 @@ if (! defined('NOREQUIRETRAN')) // Define some constants used for style of arrays $bc=array(0=>'class="impair"',1=>'class="pair"'); -$bcdd=array(0=>'class="impair drag drop"',1=>'class="pair drag drop"'); -$bcnd=array(0=>'class="impair nodrag nodrop nohover"',1=>'class="pair nodrag nodrop nohoverpair"'); // Used for tr to add new lines -$bctag=array(0=>'class="impair tagtr"',1=>'class="pair tagtr"'); +$bcdd=array(0=>'class="drag drop"',1=>'class="drag drop"'); +$bcnd=array(0=>'class="nodrag nodrop nohover"',1=>'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines +$bctag=array(0=>'class="tagtr"',1=>'class="pair tagtr"'); // Define messages variables $mesg=''; $warning=''; $error=0; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index a09e9d3db39..fbb75e021ff 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -197,7 +197,7 @@ else $head=actions_prepare_head($act); - dol_fiche_head($head, 'resources', $langs->trans("Action"),0,'action'); + dol_fiche_head($head, 'resources', $langs->trans("Action"), -1, 'action'); $linkback =img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"'); $linkback.= ''.$langs->trans("BackToList").''; @@ -327,7 +327,7 @@ else require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; $head = societe_prepare_head($socstatic); - dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"), -1, 'company'); dol_banner_tab($socstatic, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom', '', '&element='.$element); @@ -363,7 +363,7 @@ else if (is_object($fichinter)) { $head=fichinter_prepare_head($fichinter); - dol_fiche_head($head, 'resource', $langs->trans("InterventionCard"),0,'intervention'); + dol_fiche_head($head, 'resource', $langs->trans("InterventionCard"), -1, 'intervention'); // Intervention card $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c8c0dda380b..51a5ab39889 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2462,7 +2462,7 @@ div.refidpadding { } div.refid { font-weight: bold; - color: #866; + color: #868; font-size: 160%; } div.refidno { @@ -2916,6 +2916,7 @@ span.boxstatstext { span.boxstatsindicator { font-size: 130%; font-weight: normal; + line-height: 29px; } span.dashboardlineindicator, span.dashboardlineindicatorlate { font-size: 130%; @@ -2929,17 +2930,32 @@ span.dashboardlineok { } span.dashboardlineko { color: #FFF; - font-size: 80%; + /*color: #8c4446 ! important; + padding-left: 1px;*/ + + font-size: 80%; } .dashboardlinelatecoin { float: right; position: relative; text-align: right; - top: -28px; - padding: 1px 6px 1px 6px; + top: -24px; + padding: 1px 2px 1px 2px; + border-radius: .25em; + + background-color: #af4705; + padding: 0px 5px 0px 5px; + top: -26px; +} +.imglatecoin { + padding: 1px 3px 1px 1px; + margin-left: 4px; + margin-right: 2px; background-color: #8c4446; color: #FFFFFF ! important; border-radius: .25em; + display: inline-block; + vertical-align: middle; } .boxtable { margin-bottom: 8px !important;