Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2023-03-04 15:26:46 +01:00
commit 56780311b4
24 changed files with 129 additions and 82 deletions

View File

@ -1943,6 +1943,7 @@ if ($action == 'create') {
print '<tr class="field_incoterm_id">';
print '<td class="titlefieldcreate"><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
print '<td class="valuefieldcreate maxwidthonsmartphone">';
print img_picto('', 'incoterm', 'class="pictofixedwidth"');
print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''));
print '</td></tr>';
}

View File

@ -1913,6 +1913,7 @@ if ($action == 'create' && $usercancreate) {
$incoterm_id = (!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms);
$incoterm_location = (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : $soc->location_incoterms);
}
print img_picto('', 'incoterm', 'class="pictofixedwidth"');
print $form->select_incoterms($incoterm_id, $incoterm_location);
print '</td></tr>';
}

View File

@ -14,7 +14,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014-2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -3200,7 +3200,7 @@ if ($action == 'create') {
} else {
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td>';
print '<td colspan="2">';
print img_picto('', 'company').$form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status = 1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 widthcentpercentminusxx maxwidth500');
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status = 1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 widthcentpercentminusxx maxwidth500');
// Option to reload page to retrieve customer informations.
if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) {
print '<script type="text/javascript">
@ -3656,18 +3656,21 @@ if ($action == 'create') {
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td colspan="2">';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($newdateinvoice ? $newdateinvoice : $dateinvoice, '', '', '', '', "add", 1, 1);
print '</td></tr>';
// Date point of tax
if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) {
print '<tr><td class="fieldrequired">'.$langs->trans('DatePointOfTax').'</td><td colspan="2">';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($date_pointoftax ? $date_pointoftax : -1, 'date_pointoftax', '', '', '', "add", 1, 1);
print '</td></tr>';
}
// Payment term
print '<tr><td class="nowrap fieldrequired">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
print img_picto('', 'payment', 'class="pictofixedwidth"');
print $form->getSelectConditionsPaiements(GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $cond_reglement_id, 'cond_reglement_id');
print '</td></tr>';
@ -3724,7 +3727,7 @@ if ($action == 'create') {
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
print img_picto('', 'payment', 'class="pictofixedwidth"');
print img_picto('', 'bank', 'class="pictofixedwidth"');
print $form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>';
@ -3740,7 +3743,7 @@ if ($action == 'create') {
if (isModEnabled('project')) {
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td></tr>';
}
@ -3756,6 +3759,7 @@ if ($action == 'create') {
$incoterm_id = (!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms);
$incoterm_location = (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : $soc->location_incoterms);
}
print img_picto('', 'incoterm', 'class="pictofixedwidth"');
print $form->select_incoterms($incoterm_id, $incoterm_location);
print '</td></tr>';
}

View File

@ -275,9 +275,8 @@ class Paiement extends CommonObject
return -1;
}
if (empty($currencyofpayment)) {
$currencyofpayment = $this->multicurrency_code[$key];
}
if ($currencyofpayment != $this->multicurrency_code[$key]) {
$currencyofpayment = isset($this->multicurrency_code[$key]) ? $this->multicurrency_code[$key] : "";
} elseif ($currencyofpayment != $this->multicurrency_code[$key]) {
// If we have invoices with different currencies in the payment, we stop here
$this->error = 'ErrorYouTryToPayInvoicesWithDifferentCurrenciesInSamePayment';
return -1;

View File

@ -697,7 +697,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>';
} else {
print '<tr><td><label for="socid">'.$langs->trans("ThirdParty").'</label></td><td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'company').$form->select_company($socid, 'socid', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company($socid, 'socid', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print '</td></tr>';
}
}
@ -749,7 +749,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Country
print '<tr><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
print $form->select_country((GETPOST("country_id", 'alpha') ? GETPOST("country_id", 'alpha') : $object->country_id), 'country_id');
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
@ -783,26 +783,26 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Phone / Fax
print '<tr><td>'.$form->editfieldkey('PhonePro', 'phone_pro', '', $object, 0).'</td>';
print '<td>';
print img_picto('', 'object_phoning');
print img_picto('', 'object_phoning', 'class="pictofixedwidth"');
print '<input type="text" name="phone_pro" id="phone_pro" class="maxwidth200" value="'.(GETPOSTISSET('phone_pro') ? GETPOST('phone_pro', 'alpha') : $object->phone_pro).'"></td>';
if ($conf->browser->layout == 'phone') {
print '</tr><tr>';
}
print '<td>'.$form->editfieldkey('PhonePerso', 'phone_perso', '', $object, 0).'</td>';
print '<td>';
print img_picto('', 'object_phoning');
print img_picto('', 'object_phoning', 'class="pictofixedwidth"');
print '<input type="text" name="phone_perso" id="phone_perso" class="maxwidth200" value="'.(GETPOSTISSET('phone_perso') ? GETPOST('phone_perso', 'alpha') : $object->phone_perso).'"></td></tr>';
print '<tr><td>'.$form->editfieldkey('PhoneMobile', 'phone_mobile', '', $object, 0).'</td>';
print '<td>';
print img_picto('', 'object_phoning_mobile');
print img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"');
print '<input type="text" name="phone_mobile" id="phone_mobile" class="maxwidth200" value="'.(GETPOSTISSET('phone_mobile') ? GETPOST('phone_mobile', 'alpha') : $object->phone_mobile).'"></td>';
if ($conf->browser->layout == 'phone') {
print '</tr><tr>';
}
print '<td>'.$form->editfieldkey('Fax', 'fax', '', $object, 0).'</td>';
print '<td>';
print img_picto('', 'object_phoning_fax');
print img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"');
print '<input type="text" name="fax" id="fax" class="maxwidth200" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $object->fax).'"></td>';
print '</tr>';
@ -813,7 +813,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Email
print '<tr><td>'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '').'</td>';
print '<td>';
print img_picto('', 'object_email');
print img_picto('', 'object_email', 'class="pictofixedwidth"');
print '<input type="text" name="email" id="email" value="'.(GETPOSTISSET('email') ? GETPOST('email', 'alpha') : $object->email).'"></td>';
print '</tr>';
@ -869,7 +869,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1);
print img_picto('', 'category').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%');
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%');
print "</td></tr>";
}
@ -1166,7 +1166,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print img_picto('', 'category').$form->multiselectarray('contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%');
print "</td></tr>";
}

View File

@ -1209,6 +1209,7 @@ if ($action == 'create') {
print '</td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($datecontrat, '', 0, 0, '', "contrat");
print "</td></tr>";
@ -1219,6 +1220,7 @@ if ($action == 'create') {
$formproject = new FormProjets($db);
print '<tr><td>'.$langs->trans("Project").'</td><td>';
print img_picto('', 'project', 'class="pictofixedwidth"');
$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, "projectid", 0, 0, 1, 1);
print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
print "</td></tr>";

View File

@ -1277,7 +1277,7 @@ class FormTicket
}
// Load translation files required by the page
$langs->loadLangs(array('other', 'mails'));
$langs->loadLangs(array('other', 'mails', 'ticket'));
// Clear temp files. Must be done at beginning, before call of triggers
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) {
@ -1467,11 +1467,13 @@ class FormTicket
print '</td></tr>';
// Recipients / adressed-to
print '<tr class="email_line"><td>'.$langs->trans('MailRecipients').'</td><td>';
print '<tr class="email_line"><td>'.$langs->trans('MailRecipients');
print ' '.$form->textwithpicto('', $langs->trans("TicketMessageRecipientsHelp"), 1, 'help');
print '</td><td>';
if ($res) {
// Retrieve email of all contacts (internal and external)
$contacts = $ticketstat->getInfosTicketInternalContact();
$contacts = array_merge($contacts, $ticketstat->getInfosTicketExternalContact());
$contacts = $ticketstat->getInfosTicketInternalContact(1);
$contacts = array_merge($contacts, $ticketstat->getInfosTicketExternalContact(1));
$sendto = array();

View File

@ -47,7 +47,8 @@ $cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothattendeecard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
//$lineid = GETPOST('lineid', 'int');
$lineid = GETPOST('lineid', 'int');
$mode = GETPOST('mode', 'alpha');
$conf_or_booth_id = GETPOST('conforboothid', 'int');
$fk_project = GETPOST('fk_project', 'int');
@ -233,7 +234,7 @@ if (!empty($withproject)) {
// Title
$morehtmlref .= $projectstatic->title;
// Thirdparty
if ($projectstatic->thirdparty->id > 0) {
if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '</div>';
@ -384,7 +385,7 @@ if (!empty($withproject)) {
//print '</span>';
print '</td><td>';
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$encodedsecurekey = dol_hash(getDolGlobalString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
@ -401,7 +402,7 @@ if (!empty($withproject)) {
//print '</span>';
print '</td><td>';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.$projectstatic->id.'&type=global';
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$encodedsecurekey = dol_hash(getDolGlobalString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
@ -563,7 +564,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card
// ------------------------------------------------------------
$linkback = '<a href="'.dol_buildpath('/eventorganization/conferenceorboothattendee_list.php', 1).'?restore_lastsearch_values=1'.($confOrBooth->id > 0 ? '&conforboothid='.((int) $confOrBooth->id) : '').$moreparam.'">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.dol_buildpath('/eventorganization/conferenceorboothattendee_list.php', 1).'?restore_lastsearch_values=1'.(!empty($confOrBooth->id) && $confOrBooth->id > 0 ? '&conforboothid='.((int) $confOrBooth->id) : '').$moreparam.'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
@ -610,7 +611,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken(), '', $permissiontoadd);
// Clone
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd);
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd);
// Delete (need delete permission, or if draft, just need create/modify permission)
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));

View File

@ -57,6 +57,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selec
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothattendeelist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$mode = GETPOST('mode', 'alpha');
$id = GETPOST('id', 'int');
$conf_or_booth_id = GETPOST('conforboothid', 'int');
@ -239,11 +240,6 @@ $now = dol_now();
//$help_url="EN:Module_ConferenceOrBoothAttendee|FR:Module_ConferenceOrBoothAttendee_FR|ES:Módulo_ConferenceOrBoothAttendee";
$help_url = '';
if ($confOrBooth->id > 0) {
$title = $langs->trans('ListOfAttendeesPerConference');
} else {
$title = $langs->trans('ListOfAttendeesOfEvent');
}
$morejs = array();
$morecss = array();
@ -377,7 +373,11 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
exit;
}
if ($confOrBooth->id > 0) {
$title = $langs->trans('ListOfAttendeesPerConference');
} else {
$title = $langs->trans('ListOfAttendeesOfEvent');
}
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
@ -412,7 +412,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
// Title
$morehtmlref .= $projectstatic->title;
// Thirdparty
if ($projectstatic->thirdparty->id > 0) {
if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
}
$morehtmlref .= '</div>';
@ -591,7 +591,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
//print '</span>';
print '</td><td>';
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$encodedsecurekey = dol_hash(getDolUserString("EVENTORGANIZATION_SECUREKEYEVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
@ -608,7 +608,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
//print '</span>';
print '</td><td>';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.$projectstatic->id.'&type=global';
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$encodedsecurekey = dol_hash(getDolUserString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
@ -630,7 +630,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
if (empty($confOrBooth->id)) {
$head = conferenceorboothProjectPrepareHead($projectstatic);
$tab = 'attendees';
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project'), 0, '', 'reposition');
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, (!empty($project->public) ? 'projectpub' : 'project'), 0, '', 'reposition');
}
}
@ -797,11 +797,11 @@ foreach ($object->fields as $key => $val) {
if (!empty($arrayfields['t.'.$key]['checked'])) {
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1);
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
} elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.(isset($search[$key]) ? dol_escape_htmltag($search[$key]) : "").'">';
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
print '<div class="nowrap">';
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
@ -872,6 +872,7 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
// --------------------------------------------------------------------
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
@ -880,7 +881,6 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
// Store properties in $object
$object->setVarsFromFetchObj($obj);
// Show here line of result
print '<tr class="oddeven">';
foreach ($object->fields as $key => $val) {

View File

@ -944,7 +944,7 @@ if ($action == 'create') {
$langs->load("projects");
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
print img_picto('', 'project');
print img_picto('', 'project', 'class="pictofixedwidth"');
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
print ' <a class="paddingleft" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
print '</td>';
@ -954,6 +954,7 @@ if ($action == 'create') {
// Date delivery planned
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">';
print img_picto('', 'action', 'class="pictofixedwidth"');
$date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print "</td>\n";
@ -978,7 +979,9 @@ if ($action == 'create') {
// Weight
print '<tr><td>';
print $langs->trans("Weight");
print '</td><td colspan="3"><input name="weight" size="4" value="'.GETPOST('weight', 'int').'"> ';
print '</td><td colspan="3">';
print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"');
print '<input name="weight" size="4" value="'.GETPOST('weight', 'int').'"> ';
$text = $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOST('weight_units', 'int'), 0, 2);
$htmltext = $langs->trans("KeepEmptyForAutoCalculation");
print $form->textwithpicto($text, $htmltext);
@ -986,7 +989,9 @@ if ($action == 'create') {
// Dim
print '<tr><td>';
print $langs->trans("Width").' x '.$langs->trans("Height").' x '.$langs->trans("Depth");
print ' </td><td colspan="3"><input name="sizeW" size="4" value="'.GETPOST('sizeW', 'int').'">';
print ' </td><td colspan="3">';
print img_picto('', 'fa-ruler', 'class="pictofixedwidth"');
print '<input name="sizeW" size="4" value="'.GETPOST('sizeW', 'int').'">';
print ' x <input name="sizeH" size="4" value="'.GETPOST('sizeH', 'int').'">';
print ' x <input name="sizeS" size="4" value="'.GETPOST('sizeS', 'int').'">';
print ' ';
@ -999,6 +1004,7 @@ if ($action == 'create') {
print "<tr><td>".$langs->trans("DeliveryMethod")."</td>";
print '<td colspan="3">';
$expe->fetch_delivery_methods();
print img_picto('', 'dolly', 'class="pictofixedwidth"');
print $form->selectarray("shipping_method_id", $expe->meths, GETPOST('shipping_method_id', 'int'), 1, 0, 0, "", 1);
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
@ -1008,6 +1014,7 @@ if ($action == 'create') {
// Tracking number
print "<tr><td>".$langs->trans("TrackingNumber")."</td>";
print '<td colspan="3">';
print img_picto('', 'barcode', 'class="pictofixedwidth"');
print '<input name="tracking_number" size="20" value="'.GETPOST('tracking_number', 'alpha').'">';
print "</td></tr>\n";
@ -1030,6 +1037,7 @@ if ($action == 'create') {
print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1).'</label></td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'incoterm', 'class="pictofixedwidth"');
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''));
print '</td></tr>';
}
@ -1040,6 +1048,7 @@ if ($action == 'create') {
if (count($list) > 1) {
print "<tr><td>".$langs->trans("DefaultModel")."</td>";
print '<td colspan="3">';
print img_picto('', 'pdf', 'class="pictofixedwidth"');
print $form->selectarray('model', $list, $conf->global->EXPEDITION_ADDON_PDF);
print "</td></tr>\n";
}

View File

@ -1780,6 +1780,7 @@ if ($action == 'create') {
print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1).'</label></td>';
print '<td class="maxwidthonsmartphone">';
print img_picto('', 'incoterm', 'class="pictofixedwidth"');
print $form->select_incoterms($fkincoterms, $locincoterms);
print '</td></tr>';
}

View File

@ -9,7 +9,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
@ -756,8 +756,8 @@ if (empty($reshook)) {
$object->date_echeance = $datedue;
$object->note_public = GETPOST('note_public', 'restricthtml');
$object->note_private = GETPOST('note_private', 'restricthtml');
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
$object->fk_project = ($tmpproject > 0) ? $tmpproject : null;
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
@ -2179,7 +2179,7 @@ if ($action == 'create') {
print $societe->getNomUrl(1, 'supplier');
print '<input type="hidden" name="socid" value="'.$societe->id.'">';
} else {
print img_picto('', 'company').$form->select_company(empty($societe->id) ? 0 : $societe->id, 'socid', '(s.fournisseur = 1 AND s.status = 1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 widthcentpercentminusxx maxwidth500');
print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(empty($societe->id) ? 0 : $societe->id, 'socid', '(s.fournisseur = 1 AND s.status = 1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth175 widthcentpercentminusxx maxwidth500');
// reload page to retrieve supplier informations
if (empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE_DISABLED)) {
print '<script type="text/javascript">
@ -2521,16 +2521,19 @@ if ($action == 'create') {
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($dateinvoice, '', '', '', '', "add", 1, 1);
print '</td></tr>';
// Payment term
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
print img_picto('', 'payment', 'class="pictofixedwidth"');
print $form->getSelectConditionsPaiements(GETPOSTISSET('cond_reglement_id') ?GETPOST('cond_reglement_id', 'int') : $cond_reglement_id, 'cond_reglement_id');
print '</td></tr>';
// Due date
print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($datedue, 'ech', '', '', '', "add", 1, 1);
print '</td></tr>';
@ -2563,6 +2566,7 @@ if ($action == 'create') {
print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->label_incoterms) ? $objectsrc->label_incoterms : '', 1).'</label></td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'incoterm', 'class="pictofixedwidth"');
print $form->select_incoterms(GETPOSTISSET('incoterm_id') ? GETPOST('incoterm_id', 'alphanohtml') : (!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), GETPOSTISSET('location_incoterms') ? GETPOST('location_incoterms', 'alphanohtml') : (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : ''));
print '</td></tr>';
}
@ -2572,6 +2576,7 @@ if ($action == 'create') {
print '<tr>';
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
print '<td class="maxwidthonsmartphone">';
print img_picto('', 'currency', 'class="pictofixedwidth"');
print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ?GETPOST('multicurrency_code', 'alpha') : $currency_code), 'multicurrency_code');
print '</td></tr>';
}

View File

@ -247,6 +247,7 @@ TicketAssignedEmailBody=You have been assigned the ticket #%s by %s
MarkMessageAsPrivate=Mark message as private
TicketMessageSendEmailHelp=An email will be sent to all assigned contact (internal contacts, but also external contacts except if the option "%s" is checked)
TicketMessagePrivateHelp=This message will not display to external users
TicketMessageRecipientsHelp=Recipient field completed with active contacts linked to the ticket
TicketEmailOriginIssuer=Issuer at origin of the tickets
InitialMessage=Initial Message
LinkToAContract=Link to a contract

View File

@ -162,7 +162,7 @@ $TCats = $form->select_all_categories('product', array(), '', 64, 0, 1);
print '<tr>';
print '<td class="titlefield">'.$langs->trans('Category').'</td>';
print '<td class="maxwidthonsmartphone" colspan="4">';
print img_picto('', 'category').$form->multiselectarray('categories', $TCats, $TSelectedCats, 0, 0, 'quatrevingtpercent widthcentpercentminusx');
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $TCats, $TSelectedCats, 0, 0, 'quatrevingtpercent widthcentpercentminusx');
print '</td>';
print '</tr>';

View File

@ -126,7 +126,7 @@ $TCats = $form->select_all_categories('product', array(), '', 64, 0, 1);
print '<tr>';
print '<td class="titlefield">'.$langs->trans('Category').'</td>';
print '<td class="maxwidthonsmartphone" colspan="4">';
print img_picto('', 'category').$form->multiselectarray('categories', $TCats, $TSelectedCats, 0, 0, 'quatrevingtpercent widthcentpercentminusx');
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $TCats, $TSelectedCats, 0, 0, 'quatrevingtpercent widthcentpercentminusx');
print '</td>';
print '</tr>';

View File

@ -1445,6 +1445,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) {
$tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type);
}
print img_picto('', 'barcode', 'class="pictofixedwidth"');
print '<input class="maxwidth100" type="text" name="barcode" value="'.dol_escape_htmltag($tmpcode).'">';
print '</td></tr>';
}
@ -1504,6 +1505,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Duration
if ($type == 1) {
print '<tr><td>'.$langs->trans("Duration").'</td><td>';
print img_picto('', 'clock', 'class="pictofixedwidth"');
print '<input name="duration_value" size="4" value="'.GETPOST('duration_value', 'int').'">';
print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOST('duration_value', 'alpha') : 'h'), 0, 1);
@ -1531,6 +1533,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
// Brut Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"');
print '<input name="weight" size="4" value="'.GETPOST('weight').'">';
print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ?GETPOST('weight_units', 'alpha') : (empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2);
print '</td></tr>';
@ -1539,6 +1542,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Brut Length
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td>';
print img_picto('', 'fa-ruler', 'class="pictofixedwidth"');
print '<input name="size" class="width50" value="'.GETPOST('size').'"> x ';
print '<input name="sizewidth" class="width50" value="'.GETPOST('sizewidth').'"> x ';
print '<input name="sizeheight" class="width50" value="'.GETPOST('sizeheight').'">';
@ -1584,7 +1588,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Origin country
print '<tr><td>'.$langs->trans("CountryOrigin").'</td>';
print '<td>';
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx maxwidth500');
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
@ -1636,7 +1640,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Categories
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
@ -2200,7 +2204,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$arrayselected[] = $cat;
}
}
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}

View File

@ -383,7 +383,7 @@ if ($action == 'create') {
// Categories
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1);
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
print '</table>';
@ -945,7 +945,7 @@ if ($action == 'create') {
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}

View File

@ -816,7 +816,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1);
$arrayselected = GETPOST('categories', 'array');
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}
@ -1196,7 +1196,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, '0');
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, '0');
print "</td></tr>";
}

View File

@ -793,7 +793,7 @@ foreach ($listofreferent as $key => $value) {
for ($i = 0; $i < $num; $i++) {
$tmp = explode('_', $elementarray[$i]);
$idofelement = $tmp[0];
$idofelementuser = $tmp[1];
$idofelementuser = !empty($tmp[1]) ? $tmp[1] : "";
$element->fetch($idofelement);
if ($idofelementuser) {

View File

@ -755,7 +755,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Project
print '<tr><td class="fieldrequired">'.$langs->trans("ChildOfProjectTask").'</td><td>';
print img_picto('', 'project');
print img_picto('', 'project', 'class="pictofixedwidth"');
if ($projectoktoentertime) {
$formother->selectProjectTasks(GETPOST('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500 widthcentpercentminusxx');
} else {
@ -767,6 +767,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Assigned to
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
print img_picto('', 'user', 'class="pictofixedwidth"');
if (is_array($contactsofproject) && count($contactsofproject)) {
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300');
} else {
@ -780,21 +781,25 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Date start task
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate((!empty($date_start) ? $date_start : ''), 'dateo', 1, 1, 0, '', 1, 1);
print '</td></tr>';
// Date end task
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate((!empty($date_end) ? $date_end : -1), 'datee', -1, 1, 0, '', 1, 1);
print '</td></tr>';
// Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
print img_picto('', 'clock', 'class="pictofixedwidth"');
print $form->select_duration('planned_workload', !empty($planned_workload) ? $planned_workload : 0, 0, 'text');
print '</td></tr>';
// Progress
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
print img_picto('', 'fa-percent', 'class="pictofixedwidth"');
print $formother->select_percent($progress, 'progress', 0, 5, 0, 100, 1);
print '</td></tr>';
@ -814,8 +819,9 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print '</td></tr>';
print '<tr><td>'.$langs->trans("Budget").'</td>';
print '<td><input size="5" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET('budget_amount') ? GETPOST('budget_amount') : '').'"></td>';
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
print img_picto('', 'currency', 'class="pictofixedwidth"');
print '<input size="8" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET('budget_amount') ? GETPOST('budget_amount') : '').'"></td>';
print '</tr>';
// Other options

View File

@ -46,6 +46,7 @@ $taskref = GETPOST("taskref", 'alpha'); // task ref
$withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : '');
$mode = GETPOST('mode', 'alpha');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('projecttaskcard', 'globalcard'));

View File

@ -802,7 +802,7 @@ if ($action == 'create' || $action == 'presend') {
// Confirmation close
if ($action == 'close') {
$thirdparty_contacts = $object->getInfosTicketExternalContact();
$thirdparty_contacts = $object->getInfosTicketExternalContact(1);
$contacts_select = array(
'-2' => $langs->trans('TicketNotifyAllTiersAtClose'),
'-3' => $langs->trans('TicketNotNotifyTiersAtClose')
@ -1179,7 +1179,7 @@ if ($action == 'create' || $action == 'presend') {
$arrayselected[] = $cat->id;
}
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print '<input type="submit" class="button button-edit small" value="'.$langs->trans('Save').'">';
print '</form>';
print "</td>";

View File

@ -2039,13 +2039,14 @@ class Ticket extends CommonObject
}
/**
* Retrieve informations about internal contacts
* Retrieve informations about internal contacts
*
* @return array Array with datas : firstname, lastname, socid (-1 for internal users), email, code, libelle, status
* @param int $status Status of user or company
* @return array Array with datas : firstname, lastname, socid (-1 for internal users), email, code, libelle, status
*/
public function getInfosTicketInternalContact()
public function getInfosTicketInternalContact($status = -1)
{
return $this->listeContact(-1, 'internal');
return $this->listeContact(-1, 'internal', 0, '', $status);
}
/**
@ -2061,11 +2062,12 @@ class Ticket extends CommonObject
/**
* Retrieve informations about external contacts
*
* @return array Array with datas : firstname, lastname, socid (-1 for internal users), email, code, libelle, status
* @param int $status Status of user or company
* @return array Array with datas : firstname, lastname, socid (-1 for internal users), email, code, libelle, status
*/
public function getInfosTicketExternalContact()
public function getInfosTicketExternalContact($status = -1)
{
return $this->listeContact(-1, 'external');
return $this->listeContact(-1, 'external', 0, '', $status);
}
/**
@ -2129,13 +2131,14 @@ class Ticket extends CommonObject
* Get array of all contacts for a ticket
* Override method of file commonobject.class.php to add phone number
*
* @param int $status Status of lines to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
* @return array|int Array of contacts
* @param int $statusoflink Status of lines to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
* @param int $status Status of user or company
* @return array|int Array of contacts
*/
public function listeContact($status = -1, $source = 'external', $list = 0, $code = '')
public function listeContact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1)
{
global $langs;
@ -2175,10 +2178,16 @@ class Ticket extends CommonObject
$sql .= " AND tc.element='".$this->db->escape($this->element)."'";
if ($source == 'internal') {
$sql .= " AND tc.source = 'internal'";
if ($status >= 0) {
$sql .= " AND t.statut = ".((int) $status);
}
}
if ($source == 'external' || $source == 'thirdparty') {
$sql .= " AND tc.source = 'external'";
if ($status >= 0) {
$sql .= " AND t.statut = ".((int) $status);
}
}
if (!empty($code)) {
@ -2186,8 +2195,8 @@ class Ticket extends CommonObject
}
$sql .= " AND tc.active=1";
if ($status >= 0) {
$sql .= " AND ec.statut = ".((int) $status);
if ($statusoflink >= 0) {
$sql .= " AND ec.statut = ".((int) $statusoflink);
}
$sql .= " ORDER BY t.lastname ASC";
@ -2498,7 +2507,7 @@ class Ticket extends CommonObject
*/
if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED)) {
// Retrieve internal contact datas
$internal_contacts = $object->getInfosTicketInternalContact();
$internal_contacts = $object->getInfosTicketInternalContact(1);
$assigned_user_dont_have_email = '';
@ -2588,7 +2597,7 @@ class Ticket extends CommonObject
*/
if ($send_email > 0) {
// Retrieve internal contact datas
$internal_contacts = $object->getInfosTicketInternalContact();
$internal_contacts = $object->getInfosTicketInternalContact(1);
$sendto = array();
if (is_array($internal_contacts) && count($internal_contacts) > 0) {
@ -2657,7 +2666,7 @@ class Ticket extends CommonObject
*/
if (empty($object->private)) {
// Retrieve email of all contacts (external)
$external_contacts = $object->getInfosTicketExternalContact();
$external_contacts = $object->getInfosTicketExternalContact(1);
// If no contact, get email from thirdparty
if (is_array($external_contacts) && count($external_contacts) === 0) {
@ -2802,8 +2811,8 @@ class Ticket extends CommonObject
// If no receiver defined, load all ticket linked contacts
if (!is_array($array_receiver) || !count($array_receiver) > 0) {
$array_receiver = $this->getInfosTicketInternalContact();
$array_receiver = array_merge($array_receiver, $this->getInfosTicketExternalContact());
$array_receiver = $this->getInfosTicketInternalContact(1);
$array_receiver = array_merge($array_receiver, $this->getInfosTicketExternalContact(1));
}
if ($send_internal_cc) {

View File

@ -45,6 +45,7 @@ $mode = GETPOST('mode', 'aZ');
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_group = GETPOST('search_group');
$search = array();
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;