This commit is contained in:
Laurent Destailleur 2017-12-09 17:29:19 +01:00
parent e3dcff7f5b
commit f22e7ee24a
6 changed files with 49 additions and 19 deletions

View File

@ -557,7 +557,7 @@ if ($resql)
$parameters=array('arrayfields'=>$arrayfields); $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['status']['checked'])) if (! empty($arrayfields['status']['checked']))

View File

@ -4505,8 +4505,10 @@ abstract class CommonObject
//Eliminate copied source object extra_fields that do not exist in target object //Eliminate copied source object extra_fields that do not exist in target object
$new_array_options=array(); $new_array_options=array();
foreach ($this->array_options as $key => $value) { foreach ($this->array_options as $key => $value) {
if (in_array(substr($key,8), array_keys($target_extrafields))) // We remove the 'options_' from $key if (in_array(substr($key,8), array_keys($target_extrafields))) // We remove the 'options_' from $key for test
$new_array_options[$key] = $value; $new_array_options[$key] = $value;
elseif (in_array($key, array_keys($target_extrafields))) // We test on $key that does not contains the 'options_' prefix
$new_array_options['options_'.$key] = $value;
} }
foreach($new_array_options as $key => $value) foreach($new_array_options as $key => $value)

View File

@ -2474,8 +2474,6 @@ else
$genallowed=$user->rights->societe->lire; $genallowed=$user->rights->societe->lire;
$delallowed=$user->rights->societe->creer; $delallowed=$user->rights->societe->creer;
$var=true;
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang); print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
} }

View File

@ -1,4 +1,21 @@
<?php <?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
// Sale representative // Sale representative
print '<tr><td>'; print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>';
@ -14,13 +31,7 @@
$listsalesrepresentatives=$object->getSalesRepresentatives($user); $listsalesrepresentatives=$object->getSalesRepresentatives($user);
$nbofsalesrepresentative=count($listsalesrepresentatives); $nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number if ($nbofsalesrepresentative > 0)
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{ {
$userstatic=new User($db); $userstatic=new User($db);
$i=0; $i=0;
@ -36,7 +47,26 @@
$userstatic->entity=$val['entity']; $userstatic->entity=$val['entity'];
print $userstatic->getNomUrl(-1); print $userstatic->getNomUrl(-1);
$i++; $i++;
if ($i < $nbofsalesrepresentative) print ', '; if ($i < $nbofsalesrepresentative)
{
print ' ';
if ($i >= 3) // We print only number
{
$userstatic->id=0;
$userstatic->login='';
$userstatic->lastname='';
$userstatic->firstname='';
$userstatic->statut=0;
$userstatic->photo='';
$userstatic->email='';
$userstatic->entity=0;
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">';
print $userstatic->getNomUrl(-1, 'nolink', 0, 1);
print '+'.($nbofsalesrepresentative - $i);
print '</a>';
break;
}
}
} }
} }
else print '<span class="opacitymedium">'.$langs->trans("NoSalesRepresentativeAffected").'</span>'; else print '<span class="opacitymedium">'.$langs->trans("NoSalesRepresentativeAffected").'</span>';

View File

@ -2055,7 +2055,7 @@ class User extends CommonObject
* Use this->id,this->lastname, this->firstname * Use this->id,this->lastname, this->firstname
* *
* @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small) * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
* @param string $option On what the link point to * @param string $option On what the link point to ('leave', 'nolink', )
* @param integer $infologin Add complete info tooltip * @param integer $infologin Add complete info tooltip
* @param integer $notooltip 1=Disable tooltip on picto and name * @param integer $notooltip 1=Disable tooltip on picto and name
* @param int $maxlen Max length of visible user name * @param int $maxlen Max length of visible user name
@ -2095,7 +2095,7 @@ class User extends CommonObject
{ {
$thirdpartystatic = new Societe($db); $thirdpartystatic = new Societe($db);
$thirdpartystatic->fetch($this->societe_id); $thirdpartystatic->fetch($this->societe_id);
if (empty($hidethirdpartylogo)) $companylink = ' '.$thirdpartystatic->getNomUrl(2); // picto only of company if (empty($hidethirdpartylogo)) $companylink = ' '.$thirdpartystatic->getNomUrl(2, (($option == 'nolink')?'nolink':'')); // picto only of company
$company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')'; $company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')';
} }
$type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal")); $type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
@ -2161,7 +2161,7 @@ class User extends CommonObject
$linkend='</a>'; $linkend='</a>';
//if ($withpictoimg == -1) $result.='<div class="nowrap">'; //if ($withpictoimg == -1) $result.='<div class="nowrap">';
$result.=$linkstart; $result.=(($option == 'nolink')?'':$linkstart);
if ($withpictoimg) if ($withpictoimg)
{ {
$paddafterimage=''; $paddafterimage='';
@ -2179,7 +2179,7 @@ class User extends CommonObject
else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen); else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen);
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</div>'; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</div>';
} }
$result.=$linkend; $result.=(($option == 'nolink')?'':$linkend);
//if ($withpictoimg == -1) $result.='</div>'; //if ($withpictoimg == -1) $result.='</div>';
$result.=$companylink; $result.=$companylink;

View File

@ -492,9 +492,9 @@ else
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; /*include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'usergroup', $socid, 1); $somethingshown = $formactions->showactions($object, 'usergroup', $socid, 1);*/
print '</div></div></div>'; print '</div></div></div>';