Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
1e5d777626
2
.github/workflows/code_quality.yml
vendored
2
.github/workflows/code_quality.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
|||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
#php-version: '7.1'
|
#php-version: '7.1'
|
||||||
- name: 'Qodana Scan'
|
- name: 'Qodana Scan'
|
||||||
uses: JetBrains/qodana-action@v2022.3.3
|
uses: JetBrains/qodana-action@v2022.3.4
|
||||||
#with:
|
#with:
|
||||||
# php-version: '7.1'
|
# php-version: '7.1'
|
||||||
env:
|
env:
|
||||||
|
|||||||
@ -42,6 +42,7 @@ $langs->load("members");
|
|||||||
|
|
||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -30,6 +31,11 @@
|
|||||||
*/
|
*/
|
||||||
class Cpaiement
|
class Cpaiement
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var DoliDB Database handler.
|
||||||
|
*/
|
||||||
|
public $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Id to identify managed objects
|
* @var string Id to identify managed objects
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -145,6 +145,11 @@ $coldisplay++;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do not allow editing during a situation cycle
|
// Do not allow editing during a situation cycle
|
||||||
|
// but in some situations that is required (update legal informations for example)
|
||||||
|
if (!empty($conf->global->INVOICE_SITUATION_CAN_FORCE_UPDATE_DESCRIPTION)) {
|
||||||
|
$situationinvoicelinewithparent = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$situationinvoicelinewithparent) {
|
if (!$situationinvoicelinewithparent) {
|
||||||
// editor wysiwyg
|
// editor wysiwyg
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
@ -226,7 +231,7 @@ $coldisplay++;
|
|||||||
if ($inputalsopricewithtax) {
|
if ($inputalsopricewithtax) {
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
print '<td class="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(GETPOSTISSET('price_ttc') ? GETPOST('price_ttc') : (isset($line->pu_ttc) ? price($line->pu_ttc, 0, '', 0) : '')).'"';
|
print '<td class="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(GETPOSTISSET('price_ttc') ? GETPOST('price_ttc') : (isset($line->pu_ttc) ? price($line->pu_ttc, 0, '', 0) : '')).'"';
|
||||||
if ($line->fk_prev_id != null) {
|
if ($situationinvoicelinewithparent) {
|
||||||
print ' readonly';
|
print ' readonly';
|
||||||
}
|
}
|
||||||
print '></td>';
|
print '></td>';
|
||||||
|
|||||||
@ -315,10 +315,6 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
if ($objp->type == Facture::TYPE_CREDIT_NOTE) {
|
|
||||||
$objp->qty = -($objp->qty);
|
|
||||||
}
|
|
||||||
|
|
||||||
$total_ht += $objp->total_ht;
|
$total_ht += $objp->total_ht;
|
||||||
$total_qty += $objp->qty;
|
$total_qty += $objp->qty;
|
||||||
|
|
||||||
|
|||||||
@ -314,10 +314,6 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
if ($objp->type == Facture::TYPE_CREDIT_NOTE) {
|
|
||||||
$objp->qty = -($objp->qty);
|
|
||||||
}
|
|
||||||
|
|
||||||
$total_ht += $objp->total_ht;
|
$total_ht += $objp->total_ht;
|
||||||
$total_qty += $objp->qty;
|
$total_qty += $objp->qty;
|
||||||
|
|
||||||
|
|||||||
@ -2373,4 +2373,37 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Return clicable link of object (with eventually picto)
|
||||||
|
*
|
||||||
|
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||||
|
* @return string HTML Code for Kanban thumb.
|
||||||
|
*/
|
||||||
|
public function getKanbanView($option = '')
|
||||||
|
{
|
||||||
|
global $langs,$user;
|
||||||
|
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||||
|
$return .= '<div class="info-box info-box-sm">';
|
||||||
|
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||||
|
$return .= img_picto('', $this->picto);
|
||||||
|
//$return .= '<i class="fa fa-dol-action"></i>'; // Can be image
|
||||||
|
$return .= '</span>';
|
||||||
|
$return .= '<div class="info-box-content">';
|
||||||
|
$return .= '<span class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
|
||||||
|
if (property_exists($this, 'date_start_event')) {
|
||||||
|
$return .= '<br><span class="info-bo-label opacitymedium">'.$langs->trans("DateStart").'</span>';
|
||||||
|
$return .= '<span class="info-box-label "> : '.dol_print_date($this->db->jdate($this->date_start_event), 'day').'</>';
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'user_author_id')) {
|
||||||
|
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Author").'</span>';
|
||||||
|
$return .= '<span> : '.$user->getNomUrl(1).'</span>';
|
||||||
|
}
|
||||||
|
if (method_exists($this, 'getLibStatut')) {
|
||||||
|
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
||||||
|
}
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
$return .= '</div>';
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,6 +56,8 @@ $confirm = GETPOST('confirm', 'alpha');
|
|||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'projectlist';
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'projectlist';
|
||||||
|
$mode = GETPOST('mode', 'alpha');
|
||||||
|
|
||||||
|
|
||||||
$title = $langs->trans("Projects");
|
$title = $langs->trans("Projects");
|
||||||
|
|
||||||
@ -730,6 +732,9 @@ llxHeader('', $title, $help_url);
|
|||||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
|
if (!empty($mode)) {
|
||||||
|
$param .= '&mode='.urlencode($mode);
|
||||||
|
}
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
@ -919,7 +924,11 @@ if (!empty($socid)) {
|
|||||||
if ($search_usage_event_organization == 1) {
|
if ($search_usage_event_organization == 1) {
|
||||||
$url .= '&usage_organize_event=1';
|
$url .= '&usage_organize_event=1';
|
||||||
}
|
}
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url, '', $user->rights->projet->creer);
|
|
||||||
|
$newcardbutton = '';
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url, '', $user->rights->projet->creer);
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
@ -931,6 +940,8 @@ print '<input type="hidden" name="action" value="list">';
|
|||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
|
||||||
|
|
||||||
// Show description of content
|
// Show description of content
|
||||||
$texthelp = '';
|
$texthelp = '';
|
||||||
@ -1372,469 +1383,461 @@ while ($i < $imaxinloop) {
|
|||||||
$companystatic->town = $obj->town;
|
$companystatic->town = $obj->town;
|
||||||
$companystatic->country_code = $obj->country_code;
|
$companystatic->country_code = $obj->country_code;
|
||||||
|
|
||||||
// Author
|
if ($mode == 'kanban') {
|
||||||
$userstatic->id = $obj->fk_user_creat;
|
if ($i == 0) {
|
||||||
$userstatic->login = $obj->login;
|
print '<tr><td colspan="12">';
|
||||||
$userstatic->lastname = $obj->lastname;
|
print '<div class="box-flex-container">';
|
||||||
$userstatic->firstname = $obj->firstname;
|
}
|
||||||
$userstatic->email = $obj->user_email;
|
$object->date_start_event = $obj->date_start;
|
||||||
$userstatic->statut = $obj->user_statut;
|
|
||||||
$userstatic->entity = $obj->entity;
|
|
||||||
$userstatic->photo = $obj->photo;
|
|
||||||
$userstatic->office_phone = $obj->office_phone;
|
|
||||||
$userstatic->office_fax = $obj->office_fax;
|
|
||||||
$userstatic->user_mobile = $obj->user_mobile;
|
|
||||||
$userstatic->job = $obj->job;
|
|
||||||
$userstatic->gender = $obj->gender;
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
$userstatic->id = $obj->fk_user_creat;
|
||||||
|
$object->user_author_id = $userstatic->id;
|
||||||
|
//var_dump($object->user_author_id);exit;
|
||||||
|
print $object->getKanbanView('');
|
||||||
|
|
||||||
// Action column
|
if ($i == min($num, $limit)-1) {
|
||||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
print '</div>';
|
||||||
print '<td class="nowrap center">';
|
print '</td></tr>';
|
||||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
|
||||||
$selected = 0;
|
|
||||||
if (in_array($obj->id, $arrayofselected)) {
|
|
||||||
$selected = 1;
|
|
||||||
}
|
|
||||||
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
} else {
|
||||||
if (!$i) {
|
print '<tr class="oddeven">';
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
// Action column
|
||||||
}
|
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
// Project url
|
print '<td class="nowrap center">';
|
||||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
print '<td class="nowraponall">';
|
$selected = 0;
|
||||||
print $object->getNomUrl(1, (!empty(GETPOST('search_usage_event_organization', 'int'))?'eventorganization':''));
|
if (in_array($obj->id, $arrayofselected)) {
|
||||||
if ($object->hasDelay()) {
|
$selected = 1;
|
||||||
print img_warning($langs->trans('Late'));
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Title
|
|
||||||
if (!empty($arrayfields['p.title']['checked'])) {
|
|
||||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">';
|
|
||||||
print $obj->title;
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Company
|
|
||||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
|
||||||
print '<td class="tdoverflowmax100">';
|
|
||||||
if ($obj->socid) {
|
|
||||||
print $companystatic->getNomUrl(1, '', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
|
||||||
} else {
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Alias
|
|
||||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
|
||||||
print '<td class="tdoverflowmax100">';
|
|
||||||
if ($obj->socid) {
|
|
||||||
print $companystatic->name_alias;
|
|
||||||
} else {
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Sales Representatives
|
|
||||||
if (!empty($arrayfields['commercial']['checked'])) {
|
|
||||||
print '<td class="tdoverflowmax150">';
|
|
||||||
if ($obj->socid) {
|
|
||||||
$companystatic->id = $obj->socid;
|
|
||||||
$companystatic->name = $obj->name;
|
|
||||||
$listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
|
|
||||||
$nbofsalesrepresentative = count($listsalesrepresentatives);
|
|
||||||
if ($nbofsalesrepresentative > 6) {
|
|
||||||
// We print only number
|
|
||||||
print $nbofsalesrepresentative;
|
|
||||||
} elseif ($nbofsalesrepresentative > 0) {
|
|
||||||
$userstatic = new User($db);
|
|
||||||
$j = 0;
|
|
||||||
foreach ($listsalesrepresentatives as $val) {
|
|
||||||
$userstatic->id = $val['id'];
|
|
||||||
$userstatic->lastname = $val['lastname'];
|
|
||||||
$userstatic->firstname = $val['firstname'];
|
|
||||||
$userstatic->email = $val['email'];
|
|
||||||
$userstatic->statut = $val['statut'];
|
|
||||||
$userstatic->entity = $val['entity'];
|
|
||||||
$userstatic->photo = $val['photo'];
|
|
||||||
$userstatic->login = $val['login'];
|
|
||||||
$userstatic->office_phone = $val['office_phone'];
|
|
||||||
$userstatic->office_fax = $val['office_fax'];
|
|
||||||
$userstatic->user_mobile = $val['user_mobile'];
|
|
||||||
$userstatic->job = $val['job'];
|
|
||||||
$userstatic->gender = $val['gender'];
|
|
||||||
print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
|
|
||||||
$j++;
|
|
||||||
if ($j < $nbofsalesrepresentative) {
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
}
|
}
|
||||||
//else print $langs->trans("NoSalesRepresentativeAffected");
|
print '</td>';
|
||||||
} else {
|
if (!$i) {
|
||||||
print ' ';
|
$totalarray['nbfield']++;
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Date start project
|
|
||||||
if (!empty($arrayfields['p.dateo']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
print dol_print_date($db->jdate($obj->date_start), 'day');
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Date end project
|
|
||||||
if (!empty($arrayfields['p.datee']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
print dol_print_date($db->jdate($obj->date_end), 'day');
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Visibility
|
|
||||||
if (!empty($arrayfields['p.public']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
if ($obj->public) {
|
|
||||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
|
||||||
//print $langs->trans('SharedProject');
|
|
||||||
} else {
|
|
||||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
|
||||||
//print $langs->trans('PrivateProject');
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Contacts of project
|
|
||||||
if (!empty($arrayfields['c.assigned']['checked'])) {
|
|
||||||
print '<td class="center nowraponall tdoverflowmax200">';
|
|
||||||
$ifisrt = 1;
|
|
||||||
foreach (array('internal', 'external') as $source) {
|
|
||||||
$tab = $object->liste_contact(-1, $source, 0, '', 1);
|
|
||||||
$numcontact = count($tab);
|
|
||||||
if (!empty($numcontact)) {
|
|
||||||
foreach ($tab as $contactproject) {
|
|
||||||
//var_dump($contacttask);
|
|
||||||
$cid = $contactproject['id'];
|
|
||||||
if ($source == 'internal') {
|
|
||||||
if (empty($conf->cache['user'][$cid])) {
|
|
||||||
$c = new User($db);
|
|
||||||
$c->fetch($cid);
|
|
||||||
$conf->cache['user'][$cid] = $c;
|
|
||||||
} else {
|
|
||||||
$c = $conf->cache['user'][$cid];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (empty($conf->cache['contact'][$cid])) {
|
|
||||||
$c = new Contact($db);
|
|
||||||
$c->fetch($cid);
|
|
||||||
$conf->cache['contact'][$cid] = $c;
|
|
||||||
} else {
|
|
||||||
$c = $conf->cache['contact'][$cid];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($c->photo)) {
|
|
||||||
if (get_class($c) == 'User') {
|
|
||||||
print $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
|
|
||||||
} else {
|
|
||||||
print $c->getNomUrl(-2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (get_class($c) == 'User') {
|
|
||||||
print $c->getNomUrl(2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
|
|
||||||
} else {
|
|
||||||
print $c->getNomUrl(2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$ifisrt = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
// Project url
|
||||||
if (!$i) {
|
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||||
$totalarray['nbfield']++;
|
print '<td class="nowraponall">';
|
||||||
|
print $object->getNomUrl(1, (!empty(GETPOST('search_usage_event_organization', 'int'))?'eventorganization':''));
|
||||||
|
if ($object->hasDelay()) {
|
||||||
|
print img_warning($langs->trans('Late'));
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// Title
|
||||||
// Opp Status
|
if (!empty($arrayfields['p.title']['checked'])) {
|
||||||
if (!empty($arrayfields['p.fk_opp_status']['checked'])) {
|
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).'">';
|
||||||
print '<td class="center">';
|
print $obj->title;
|
||||||
if ($obj->opp_status_code) {
|
print '</td>';
|
||||||
print $langs->trans("OppStatus".$obj->opp_status_code);
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
// Company
|
||||||
if (!$i) {
|
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||||
$totalarray['nbfield']++;
|
print '<td class="tdoverflowmax100">';
|
||||||
}
|
if ($obj->socid) {
|
||||||
}
|
print $companystatic->getNomUrl(1, '', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||||
// Opp Amount
|
|
||||||
if (!empty($arrayfields['p.opp_amount']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
//if ($obj->opp_status_code)
|
|
||||||
if (strcmp($obj->opp_amount, '')) {
|
|
||||||
print '<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1, '').'</span>';
|
|
||||||
if (empty($totalarray['val']['p.opp_amount'])) {
|
|
||||||
$totalarray['val']['p.opp_amount'] = $obj->opp_amount;
|
|
||||||
} else {
|
} else {
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Alias
|
||||||
|
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||||
|
print '<td class="tdoverflowmax100">';
|
||||||
|
if ($obj->socid) {
|
||||||
|
print $companystatic->name_alias;
|
||||||
|
} else {
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Sales Representatives
|
||||||
|
if (!empty($arrayfields['commercial']['checked'])) {
|
||||||
|
print '<td class="tdoverflowmax150">';
|
||||||
|
if ($obj->socid) {
|
||||||
|
$companystatic->id = $obj->socid;
|
||||||
|
$companystatic->name = $obj->name;
|
||||||
|
$listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
|
||||||
|
$nbofsalesrepresentative = count($listsalesrepresentatives);
|
||||||
|
if ($nbofsalesrepresentative > 6) {
|
||||||
|
// We print only number
|
||||||
|
print $nbofsalesrepresentative;
|
||||||
|
} elseif ($nbofsalesrepresentative > 0) {
|
||||||
|
$userstatic = new User($db);
|
||||||
|
$j = 0;
|
||||||
|
foreach ($listsalesrepresentatives as $val) {
|
||||||
|
$userstatic->id = $val['id'];
|
||||||
|
$userstatic->lastname = $val['lastname'];
|
||||||
|
$userstatic->firstname = $val['firstname'];
|
||||||
|
$userstatic->email = $val['email'];
|
||||||
|
$userstatic->statut = $val['statut'];
|
||||||
|
$userstatic->entity = $val['entity'];
|
||||||
|
$userstatic->photo = $val['photo'];
|
||||||
|
$userstatic->login = $val['login'];
|
||||||
|
$userstatic->office_phone = $val['office_phone'];
|
||||||
|
$userstatic->office_fax = $val['office_fax'];
|
||||||
|
$userstatic->user_mobile = $val['user_mobile'];
|
||||||
|
$userstatic->job = $val['job'];
|
||||||
|
$userstatic->gender = $val['gender'];
|
||||||
|
print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
|
||||||
|
$j++;
|
||||||
|
if ($j < $nbofsalesrepresentative) {
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//else print $langs->trans("NoSalesRepresentativeAffected");
|
||||||
|
} else {
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Date start project
|
||||||
|
if (!empty($arrayfields['p.dateo']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_start), 'day');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Date end project
|
||||||
|
if (!empty($arrayfields['p.datee']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_end), 'day');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Visibility
|
||||||
|
if (!empty($arrayfields['p.public']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($obj->public) {
|
||||||
|
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||||
|
//print $langs->trans('SharedProject');
|
||||||
|
} else {
|
||||||
|
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||||
|
//print $langs->trans('PrivateProject');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Contacts of project
|
||||||
|
if (!empty($arrayfields['c.assigned']['checked'])) {
|
||||||
|
print '<td class="center nowraponall tdoverflowmax200">';
|
||||||
|
$ifisrt = 1;
|
||||||
|
foreach (array('internal', 'external') as $source) {
|
||||||
|
$tab = $object->liste_contact(-1, $source, 0, '', 1);
|
||||||
|
$numcontact = count($tab);
|
||||||
|
if (!empty($numcontact)) {
|
||||||
|
foreach ($tab as $contactproject) {
|
||||||
|
//var_dump($contacttask);
|
||||||
|
if ($source == 'internal') {
|
||||||
|
$c = new User($db);
|
||||||
|
} else {
|
||||||
|
$c = new Contact($db);
|
||||||
|
}
|
||||||
|
$c->fetch($contactproject['id']);
|
||||||
|
if (!empty($c->photo)) {
|
||||||
|
if (get_class($c) == 'User') {
|
||||||
|
print $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
|
||||||
|
} else {
|
||||||
|
print $c->getNomUrl(-2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (get_class($c) == 'User') {
|
||||||
|
print $c->getNomUrl(2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
|
||||||
|
} else {
|
||||||
|
print $c->getNomUrl(2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$ifisrt = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Opp Status
|
||||||
|
if (!empty($arrayfields['p.fk_opp_status']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($obj->opp_status_code) {
|
||||||
|
print $langs->trans("OppStatus".$obj->opp_status_code);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Opp Amount
|
||||||
|
if (!empty($arrayfields['p.opp_amount']['checked'])) {
|
||||||
|
print '<td class="right">';
|
||||||
|
//if ($obj->opp_status_code)
|
||||||
|
if (strcmp($obj->opp_amount, '')) {
|
||||||
|
print '<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1, '').'</span>';
|
||||||
$totalarray['val']['p.opp_amount'] += $obj->opp_amount;
|
$totalarray['val']['p.opp_amount'] += $obj->opp_amount;
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'p.opp_amount';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
// Opp percent
|
||||||
if (!$i) {
|
if (!empty($arrayfields['p.opp_percent']['checked'])) {
|
||||||
$totalarray['nbfield']++;
|
print '<td class="right">';
|
||||||
|
if ($obj->opp_percent) {
|
||||||
|
print price($obj->opp_percent, 1, $langs, 1, 0).'%';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!$i) {
|
// Opp weighted amount
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'p.opp_amount';
|
if (!empty($arrayfields['opp_weighted_amount']['checked'])) {
|
||||||
}
|
if (!isset($totalarray['val']['opp_weighted_amount'])) {
|
||||||
}
|
$totalarray['val']['opp_weighted_amount'] = 0;
|
||||||
// Opp percent
|
}
|
||||||
if (!empty($arrayfields['p.opp_percent']['checked'])) {
|
print '<td align="right">';
|
||||||
print '<td class="right">';
|
if ($obj->opp_weighted_amount) {
|
||||||
if ($obj->opp_percent) {
|
print '<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1, '').'</span>';
|
||||||
print price($obj->opp_percent, 1, $langs, 1, 0).'%';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Opp weighted amount
|
|
||||||
if (!empty($arrayfields['opp_weighted_amount']['checked'])) {
|
|
||||||
if (!isset($totalarray['val']['opp_weighted_amount'])) {
|
|
||||||
$totalarray['val']['opp_weighted_amount'] = 0;
|
|
||||||
}
|
|
||||||
print '<td align="right">';
|
|
||||||
if ($obj->opp_weighted_amount) {
|
|
||||||
print '<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1, '').'</span>';
|
|
||||||
if (empty($totalarray['val']['opp_weighted_amount'])) {
|
|
||||||
$totalarray['val']['opp_weighted_amount'] = $obj->opp_weighted_amount;
|
|
||||||
} else {
|
|
||||||
$totalarray['val']['opp_weighted_amount'] += $obj->opp_weighted_amount;
|
$totalarray['val']['opp_weighted_amount'] += $obj->opp_weighted_amount;
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'opp_weighted_amount';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
// Budget
|
||||||
if (!$i) {
|
if (!empty($arrayfields['p.budget_amount']['checked'])) {
|
||||||
$totalarray['nbfield']++;
|
print '<td class="right">';
|
||||||
}
|
if ($obj->budget_amount != '') {
|
||||||
if (!$i) {
|
print '<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).'</span>';
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'opp_weighted_amount';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Budget
|
|
||||||
if (!empty($arrayfields['p.budget_amount']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->budget_amount != '') {
|
|
||||||
print '<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).'</span>';
|
|
||||||
if (empty($totalarray['val']['p.budget_amount'])) {
|
|
||||||
$totalarray['val']['p.budget_amount'] = $obj->budget_amount;
|
|
||||||
} else {
|
|
||||||
$totalarray['val']['p.budget_amount'] += $obj->budget_amount;
|
$totalarray['val']['p.budget_amount'] += $obj->budget_amount;
|
||||||
}
|
}
|
||||||
}
|
print '</td>';
|
||||||
print '</td>';
|
if (!$i) {
|
||||||
if (!$i) {
|
$totalarray['nbfield']++;
|
||||||
$totalarray['nbfield']++;
|
}
|
||||||
}
|
if (!$i) {
|
||||||
if (!$i) {
|
$totalarray['pos'][$totalarray['nbfield']] = 'p.budget_amount';
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'p.budget_amount';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Usage opportunity
|
|
||||||
if (!empty($arrayfields['p.usage_opportunity']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->usage_opportunity) {
|
|
||||||
print yn($obj->usage_opportunity);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Usage task
|
|
||||||
if (!empty($arrayfields['p.usage_task']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->usage_task) {
|
|
||||||
print yn($obj->usage_task);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Bill time
|
|
||||||
if (!empty($arrayfields['p.usage_bill_time']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->usage_bill_time) {
|
|
||||||
print yn($obj->usage_bill_time);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Event Organization
|
|
||||||
if (!empty($arrayfields['p.usage_organize_event']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->usage_organize_event) {
|
|
||||||
print yn($obj->usage_organize_event);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Allow unknown people to suggest conferences
|
|
||||||
if (!empty($arrayfields['p.accept_conference_suggestions']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->accept_conference_suggestions) {
|
|
||||||
print yn($obj->accept_conference_suggestions);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Allow unknown people to suggest booth
|
|
||||||
if (!empty($arrayfields['p.accept_booth_suggestions']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->accept_booth_suggestions) {
|
|
||||||
print yn($obj->accept_booth_suggestions);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Price of registration
|
|
||||||
if (!empty($arrayfields['p.price_registration']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->price_registration != '') {
|
|
||||||
print '<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).'</span>';
|
|
||||||
$totalarray['val']['p.price_registration'] += $obj->price_registration;
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'p.price_registration';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Price of booth
|
|
||||||
if (!empty($arrayfields['p.price_booth']['checked'])) {
|
|
||||||
print '<td class="right">';
|
|
||||||
if ($obj->price_booth != '') {
|
|
||||||
print '<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).'</span>';
|
|
||||||
$totalarray['val']['p.price_booth'] += $obj->price_booth;
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['pos'][$totalarray['nbfield']] = 'p.price_booth';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($arrayfields['u.login']['checked'])) {
|
|
||||||
print '<td class="center tdoverflowmax150">';
|
|
||||||
if ($userstatic->id) {
|
|
||||||
print $userstatic->getNomUrl(-1);
|
|
||||||
} else {
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
print "</td>\n";
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Extra fields
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
|
||||||
// Fields from hook
|
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
|
||||||
print $hookmanager->resPrint;
|
|
||||||
// Date creation
|
|
||||||
if (!empty($arrayfields['p.datec']['checked'])) {
|
|
||||||
print '<td class="center nowraponall">';
|
|
||||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Date modification
|
|
||||||
if (!empty($arrayfields['p.tms']['checked'])) {
|
|
||||||
print '<td class="center nowraponall">';
|
|
||||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Email MsgID
|
|
||||||
if (!empty($arrayfields['p.email_msgid']['checked'])) {
|
|
||||||
print '<td class="center">';
|
|
||||||
print $obj->email_msgid;
|
|
||||||
print '</td>';
|
|
||||||
if (!$i) $totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
// Import key
|
|
||||||
if (!empty($arrayfields['p.import_key']['checked'])) {
|
|
||||||
print '<td class="right">'.dol_escape_htmltag($obj->import_key).'</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Status
|
|
||||||
if (!empty($arrayfields['p.fk_statut']['checked'])) {
|
|
||||||
print '<td class="center">'.$object->getLibStatut(5).'</td>';
|
|
||||||
if (!$i) {
|
|
||||||
$totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Action column
|
|
||||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
|
||||||
print '<td class="nowrap center">';
|
|
||||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
|
||||||
$selected = 0;
|
|
||||||
if (in_array($obj->id, $arrayofselected)) {
|
|
||||||
$selected = 1;
|
|
||||||
}
|
}
|
||||||
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
// Usage opportunity
|
||||||
if (!$i) {
|
if (!empty($arrayfields['p.usage_opportunity']['checked'])) {
|
||||||
$totalarray['nbfield']++;
|
print '<td class="right">';
|
||||||
|
if ($obj->usage_opportunity) {
|
||||||
|
print yn($obj->usage_opportunity);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// Usage task
|
||||||
|
if (!empty($arrayfields['p.usage_task']['checked'])) {
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($obj->usage_task) {
|
||||||
|
print yn($obj->usage_task);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Bill time
|
||||||
|
if (!empty($arrayfields['p.usage_bill_time']['checked'])) {
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($obj->usage_bill_time) {
|
||||||
|
print yn($obj->usage_bill_time);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Event Organization
|
||||||
|
if (!empty($arrayfields['p.usage_organize_event']['checked'])) {
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($obj->usage_organize_event) {
|
||||||
|
print yn($obj->usage_organize_event);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Allow unknown people to suggest conferences
|
||||||
|
if (!empty($arrayfields['p.accept_conference_suggestions']['checked'])) {
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($obj->accept_conference_suggestions) {
|
||||||
|
print yn($obj->accept_conference_suggestions);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Allow unknown people to suggest booth
|
||||||
|
if (!empty($arrayfields['p.accept_booth_suggestions']['checked'])) {
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($obj->accept_booth_suggestions) {
|
||||||
|
print yn($obj->accept_booth_suggestions);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Price of registration
|
||||||
|
if (!empty($arrayfields['p.price_registration']['checked'])) {
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($obj->price_registration != '') {
|
||||||
|
print '<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).'</span>';
|
||||||
|
$totalarray['val']['p.price_registration'] += $obj->price_registration;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'p.price_registration';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Price of booth
|
||||||
|
if (!empty($arrayfields['p.price_booth']['checked'])) {
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($obj->price_booth != '') {
|
||||||
|
print '<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).'</span>';
|
||||||
|
$totalarray['val']['p.price_booth'] += $obj->price_booth;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'p.price_booth';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Author
|
||||||
|
$userstatic->id = $obj->fk_user_creat;
|
||||||
|
$userstatic->login = $obj->login;
|
||||||
|
$userstatic->lastname = $obj->lastname;
|
||||||
|
$userstatic->firstname = $obj->firstname;
|
||||||
|
$userstatic->email = $obj->user_email;
|
||||||
|
$userstatic->statut = $obj->user_statut;
|
||||||
|
$userstatic->entity = $obj->entity;
|
||||||
|
$userstatic->photo = $obj->photo;
|
||||||
|
$userstatic->office_phone = $obj->office_phone;
|
||||||
|
$userstatic->office_fax = $obj->office_fax;
|
||||||
|
$userstatic->user_mobile = $obj->user_mobile;
|
||||||
|
$userstatic->job = $obj->job;
|
||||||
|
$userstatic->gender = $obj->gender;
|
||||||
|
|
||||||
print "</tr>\n";
|
if (!empty($arrayfields['u.login']['checked'])) {
|
||||||
|
print '<td class="center tdoverflowmax150">';
|
||||||
|
if ($userstatic->id) {
|
||||||
|
print $userstatic->getNomUrl(-1);
|
||||||
|
} else {
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print "</td>\n";
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
|
// Fields from hook
|
||||||
|
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
// Date creation
|
||||||
|
if (!empty($arrayfields['p.datec']['checked'])) {
|
||||||
|
print '<td class="center nowraponall">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Date modification
|
||||||
|
if (!empty($arrayfields['p.tms']['checked'])) {
|
||||||
|
print '<td class="center nowraponall">';
|
||||||
|
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Email MsgID
|
||||||
|
if (!empty($arrayfields['p.email_msgid']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
print $obj->email_msgid;
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Import key
|
||||||
|
if (!empty($arrayfields['p.import_key']['checked'])) {
|
||||||
|
print '<td class="right">'.dol_escape_htmltag($obj->import_key).'</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Status
|
||||||
|
if (!empty($arrayfields['p.fk_statut']['checked'])) {
|
||||||
|
print '<td class="right">'.$object->getLibStatut(5).'</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Action column
|
||||||
|
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print '<td class="nowrap center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($obj->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user