Merge branch 'Dolibarr:develop' into develop

This commit is contained in:
Sébastien NASSIET 2023-01-04 21:12:06 +01:00 committed by GitHub
commit fc3876474c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 413 additions and 208 deletions

View File

@ -927,4 +927,46 @@ class AdherentType extends CommonObject
return ''; return '';
} }
/**
* 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 .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
if ($user->rights->adherent->configurer) {
$return .= '<span class="right paddingleft"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$this->ref.'">'.img_edit().'</a></span>';
} else {
$return .= '<span class="right">&nbsp;</span>';
}
if (property_exists($this, 'vote')) {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("VoteAllowed").' : '.yn($this->vote).'</span>';
}
if (property_exists($this, 'amount')) {
if (is_null($this->amount) || $this->amount === '') {
$return .= '<br>';
} else {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Amount").'</span>';
$return .= '<span class="amount"> : '.price($this->amount).'</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;
}
} }

View File

@ -505,4 +505,36 @@ class Subscription extends CommonObject
dol_print_error($this->db); dol_print_error($this->db);
} }
} }
/**
* 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 = '')
{
$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 .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-ref">'.(property_exists($this, 'fk_adherent')? $this->fk_adherent: $this->ref ).'</span>';
if (property_exists($this, 'dateh') || property_exists($this, 'datef')) {
$return .= '<br><span class="info-box-status opacitymedium">'.dol_print_date($this->dateh, 'day').' - '.dol_print_date($this->datef, 'day').'</span>';
}
if (property_exists($this, 'fk_bank')) {
$return .= '<br><span class="info-box-label ">'.$this->fk_bank.'</span>';
}
if (property_exists($this, 'amount')) {
$return .= '<br><div class="info-box-label margintoponly amount">'.price($this->amount).'</div>';
}
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';
return $return;
}
} }

View File

@ -37,6 +37,8 @@ $massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array'); $toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'subscriptionlist'; // To manage different context of search $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'subscriptionlist'; // To manage different context of search
$mode = GETPOST('mode', 'alpha');
$statut = (GETPOSTISSET("statut") ?GETPOST("statut", "alpha") : 1); $statut = (GETPOSTISSET("statut") ?GETPOST("statut", "alpha") : 1);
$search_ref = GETPOST('search_ref', 'alpha'); $search_ref = GETPOST('search_ref', 'alpha');
@ -253,6 +255,9 @@ llxHeader('', $title, $help_url);
$i = 0; $i = 0;
$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);
} }
@ -298,6 +303,9 @@ if (in_array($massaction, array('presend', 'predelete'))) {
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $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'));
if ($user->hasRight('adherent', 'cotisation', 'creer')) { if ($user->hasRight('adherent', 'cotisation', 'creer')) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/list.php?status=-1,1'); $newcardbutton .= dolGetButtonTitle($langs->trans('NewSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/list.php?status=-1,1');
} }
@ -313,6 +321,8 @@ 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="date_select" value="'.$date_select.'">'; print '<input type="hidden" name="date_select" value="'.$date_select.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
@ -507,6 +517,28 @@ while ($i < min($num, $limit)) {
$adherent->need_subscription = $adht->subscription; $adherent->need_subscription = $adht->subscription;
if ($mode == 'kanban') {
if ($i == 0) {
print '<tr><td colspan="12">';
print '<div class="box-flex-container">';
}
//fetch informations needs on this mode
$subscription->fk_adherent = $adherent->getNomUrl(1);
$subscription->fk_type = $adht->getNomUrl(1);
$subscription->amount = $obj->subscription;
if ($obj->fk_account > 0) {
$accountstatic->id = $obj->fk_account;
$accountstatic->fetch($obj->fk_account);
$subscription->fk_bank = $accountstatic->getNomUrl(1);
}
// Output Kanban
print $subscription->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
print '</div>';
print '</td></tr>';
}
} else {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
@ -644,6 +676,7 @@ while ($i < min($num, $limit)) {
} }
print "</tr>\n"; print "</tr>\n";
}
$i++; $i++;
} }

View File

@ -44,6 +44,7 @@ $action = GETPOST('action', 'aZ09');
$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');
$mode = GETPOST('mode', 'alopha');
$sall = GETPOST("sall", "alpha"); $sall = GETPOST("sall", "alpha");
$filter = GETPOST("filter", 'alpha'); $filter = GETPOST("filter", 'alpha');
@ -249,6 +250,9 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
$i = 0; $i = 0;
$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='.$contextpage; $param .= '&contextpage='.$contextpage;
} }
@ -257,6 +261,10 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
} }
$newcardbutton = ''; $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'));
if ($user->hasRight('adherent', 'configurer')) { if ($user->hasRight('adherent', 'configurer')) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewMemberType'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/type.php?action=create'); $newcardbutton .= dolGetButtonTitle($langs->trans('NewMemberType'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/type.php?action=create');
} }
@ -270,6 +278,8 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
print '<input type="hidden" name="action" value="list">'; 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="mode" value="'.$mode.'">';
print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
@ -303,6 +313,20 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
$membertype->amount = $objp->amount; $membertype->amount = $objp->amount;
$membertype->caneditamount = $objp->caneditamount; $membertype->caneditamount = $objp->caneditamount;
if ($mode == 'kanban') {
if ($i == 0) {
print '<tr><td colspan="12">';
print '<div class="box-flex-container">';
}
//output kanban
$membertype->label = $objp->label;
$membertype->getKanbanView('');
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}
} else {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowraponall">'; print '<td class="nowraponall">';
print $membertype->getNomUrl(1); print $membertype->getNomUrl(1);
@ -323,12 +347,13 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
print '<td class="center">'.yn($objp->caneditamount).'</td>'; print '<td class="center">'.yn($objp->caneditamount).'</td>';
print '<td class="center">'.yn($objp->vote).'</td>'; print '<td class="center">'.yn($objp->vote).'</td>';
print '<td class="center">'.$membertype->getLibStatut(5).'</td>'; print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
if ($user->hasRight('adherent', 'configurer')) { if ($user->rights->adherent->configurer) {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>'; print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
} else { } else {
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</td>';
} }
print "</tr>"; print "</tr>";
}
$i++; $i++;
} }

View File

@ -372,13 +372,13 @@ if ($mode == 'feature') {
if (count($objMod->depends)) { if (count($objMod->depends)) {
$text .= join(',', $objMod->depends); $text .= join(',', $objMod->depends);
} else { } else {
$text .= $langs->trans("None"); $text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>';
} }
$text .= '<br><strong>'.$langs->trans("RequiredBy").':</strong> '; $text .= '<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
if (count($objMod->requiredby)) { if (count($objMod->requiredby)) {
$text .= join(',', $objMod->requiredby); $text .= join(',', $objMod->requiredby);
} else { } else {
$text .= $langs->trans("None"); $text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>';
} }
$text .= '<br><br>'; $text .= '<br><br>';
@ -395,7 +395,7 @@ if ($mode == 'feature') {
$i++; $i++;
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -408,7 +408,7 @@ if ($mode == 'feature') {
$i++; $i++;
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -418,7 +418,7 @@ if ($mode == 'feature') {
if (dol_is_file($filedata)) { if (dol_is_file($filedata)) {
$text .= $langs->trans("Yes").' <span class="opacitymedium">('.$moduledir.'/sql/data.sql)</span>'; $text .= $langs->trans("Yes").' <span class="opacitymedium">('.$moduledir.'/sql/data.sql)</span>';
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -437,7 +437,7 @@ if ($mode == 'feature') {
} }
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -446,7 +446,7 @@ if ($mode == 'feature') {
if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models']) { if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models']) {
$text .= $langs->trans("Yes"); $text .= $langs->trans("Yes");
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -455,7 +455,7 @@ if ($mode == 'feature') {
if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions']) { if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions']) {
$text .= $langs->trans("Yes"); $text .= $langs->trans("Yes");
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -468,7 +468,7 @@ if ($mode == 'feature') {
$i++; $i++;
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -502,7 +502,7 @@ if ($mode == 'feature') {
$i++; $i++;
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -531,7 +531,7 @@ if ($mode == 'feature') {
$i++; $i++;
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -544,7 +544,7 @@ if ($mode == 'feature') {
$i++; $i++;
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -553,7 +553,7 @@ if ($mode == 'feature') {
if (isset($objMod->menu) && !empty($objMod->menu)) { // objMod can be an array or just an int 1 if (isset($objMod->menu) && !empty($objMod->menu)) { // objMod can be an array or just an int 1
$text .= $langs->trans("Yes"); $text .= $langs->trans("Yes");
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -566,7 +566,7 @@ if ($mode == 'feature') {
$i++; $i++;
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
@ -579,13 +579,13 @@ if ($mode == 'feature') {
$i++; $i++;
} }
} else { } else {
$text .= $langs->trans("No"); $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
} }
$text .= '<br>'; $text .= '<br>';
$text .= '<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> '; $text .= '<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
$text .= $langs->trans("DetectionNotPossible"); $text .= '<span class="opacitymedium">'.$langs->trans("DetectionNotPossible").'</span>';
} }
@ -594,7 +594,7 @@ if ($mode == 'changelog') {
if ($changelog) { if ($changelog) {
$text .= '<div class="moduledesclong">'.$changelog.'<div>'; $text .= '<div class="moduledesclong">'.$changelog.'<div>';
} else { } else {
$text .= '<div class="moduledesclong">'.$langs->trans("NotAvailable").'</div>'; $text .= '<div class="moduledesclong"><span class="opacitymedium">'.$langs->trans("NotAvailable").'</span></div>';
} }
} }

View File

@ -112,7 +112,7 @@ class Orders extends DolibarrApi
* @param string $ref Ref of object * @param string $ref Ref of object
* @param string $ref_ext External reference of object * @param string $ref_ext External reference of object
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
* @return array|mixed data without useless information * @return Object Object with cleaned properties
* *
* @throws RestException * @throws RestException
*/ */

View File

@ -123,7 +123,7 @@ class BankAccounts extends DolibarrApi
* Get account by ID. * Get account by ID.
* *
* @param int $id ID of account * @param int $id ID of account
* @return array Account object * @return Object Object with cleaned properties
* *
* @throws RestException * @throws RestException
*/ */
@ -315,7 +315,7 @@ class BankAccounts extends DolibarrApi
* *
* @param int $id ID of account * @param int $id ID of account
* @param array $request_data data * @param array $request_data data
* @return int * @return Object Object with cleaned properties
*/ */
public function put($id, $request_data = null) public function put($id, $request_data = null)
{ {

View File

@ -271,7 +271,7 @@ if (empty($reshook)) {
} }
// Delete // Delete
if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer) { if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->supprimer) {
$object->delete($user); $object->delete($user);
header("Location: ".DOL_URL_ROOT.'/compta/facture/invoicetemplate_list.php'); header("Location: ".DOL_URL_ROOT.'/compta/facture/invoicetemplate_list.php');
@ -1175,8 +1175,8 @@ if ($action == 'create') {
} }
// Confirm delete of repeatable invoice // Confirm delete of repeatable invoice
if ($action == 'ask_deleteinvoice') { if ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_delete', '', 'no', 1);
} }
// Call Hook formConfirm // Call Hook formConfirm

View File

@ -351,16 +351,18 @@ class Comment extends CommonObject
/** /**
* Load comments linked with current task * Load comments linked with current task into ->comments
* *
* @param string $element_type Element type * @param string $element_type Element type
* @param int $fk_element Id of element * @param int $fk_element Id of element
* @return array Comment array * @return int Result
*/ */
public function fetchAllFor($element_type, $fk_element) public function fetchAllFor($element_type, $fk_element)
{ {
global $db, $conf; global $db, $conf;
$this->comments = array(); $this->comments = array();
if (!empty($element_type) && !empty($fk_element)) { if (!empty($element_type) && !empty($fk_element)) {
$sql = "SELECT"; $sql = "SELECT";
$sql .= " c.rowid"; $sql .= " c.rowid";

View File

@ -198,9 +198,9 @@ class EvalMath
} }
/** /**
* vars * Function vars
* *
* @return string Output * @return array Output
*/ */
public function vars() public function vars()
{ {
@ -211,9 +211,9 @@ class EvalMath
} }
/** /**
* vars * Function funcs
* *
* @return string Output * @return array Output
*/ */
private function funcs() private function funcs()
{ {
@ -230,7 +230,7 @@ class EvalMath
* Convert infix to postfix notation * Convert infix to postfix notation
* *
* @param string $expr Expression * @param string $expr Expression
* @return string Output * @return boolean|array Output
*/ */
private function nfx($expr) private function nfx($expr)
{ {
@ -367,6 +367,7 @@ class EvalMath
} }
$output[] = $op; $output[] = $op;
} }
return $output; return $output;
} }

View File

@ -779,7 +779,7 @@ class FormTicket
* @param string $morecss More CSS * @param string $morecss More CSS
* @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes. * @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes.
* @param Translate $outputlangs Output language * @param Translate $outputlangs Output language
* @return void * @return string|void String of HTML component
*/ */
public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null) public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null)
{ {
@ -985,7 +985,6 @@ class FormTicket
} }
$sql = substr($sql, 0, -2); $sql = substr($sql, 0, -2);
$sql .= ")"; $sql .= ")";
} else {
} }
$sql .= $this->db->order('ctc.pos', 'ASC'); $sql .= $this->db->order('ctc.pos', 'ASC');

View File

@ -178,7 +178,7 @@ class SimpleOpenID
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @return void * @return array
*/ */
public function GetError() public function GetError()
{ {
@ -225,7 +225,7 @@ class SimpleOpenID
* splitResponse * splitResponse
* *
* @param string $response Server * @param string $response Server
* @return void * @return array
*/ */
public function splitResponse($response) public function splitResponse($response)
{ {

View File

@ -75,7 +75,7 @@ abstract class DoliDB implements Database
/** /**
* Return the DB prefix found into prefix_db (if it was set manually by doing $db->prefix_db=...). * Return the DB prefix found into prefix_db (if it was set manually by doing $dbhandler->prefix_db=...).
* Otherwise return MAIN_DB_PREFIX (common use). * Otherwise return MAIN_DB_PREFIX (common use).
* *
* @return string The DB prefix * @return string The DB prefix

View File

@ -907,7 +907,7 @@ class pdf_azur extends ModelePDFPropales
* @param Propal $object Object to show * @param Propal $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
* @return void * @return int
*/ */
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{ {

View File

@ -744,7 +744,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
* @param Object $object Object to show * @param Object $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
* @return void * @return int
*/ */
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{ {

View File

@ -145,13 +145,12 @@ if ($result) {
$establishmentstatic->label = $obj->label; $establishmentstatic->label = $obj->label;
$establishmentstatic->status = $obj->status; $establishmentstatic->status = $obj->status;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$establishmentstatic->getNomUrl(1).'</td>'; print '<td>'.$establishmentstatic->getNomUrl(1).'</td>';
print '<td>'.$obj->label.'</td>'; print '<td>'.dol_escape_htmltag($obj->label).'</td>';
print '<td class="left">'.$obj->address.'</td>'; print '<td>'.dol_escape_htmltag($obj->address).'</td>';
print '<td class="left">'.$obj->zip.'</td>'; print '<td>'.dol_escape_htmltag($obj->zip).'</td>';
print '<td class="left">'.$obj->town.'</td>'; print '<td>'.dol_escape_htmltag($obj->town).'</td>';
print '<td class="right">'; print '<td class="right">';
print $establishmentstatic->getLibStatut(5); print $establishmentstatic->getLibStatut(5);
print '</td>'; print '</td>';
@ -160,7 +159,7 @@ if ($result) {
$i++; $i++;
} }
} else { } else {
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>'; print '<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
} }
print '</table>'; print '</table>';

View File

@ -86,7 +86,7 @@ SaveAddSkill = Skill(s) added
SaveLevelSkill = Skill(s) level saved SaveLevelSkill = Skill(s) level saved
DeleteSkill = Skill removed DeleteSkill = Skill removed
SkillsExtraFields=Attributs supplémentaires (Compétences) SkillsExtraFields=Attributs supplémentaires (Compétences)
JobsExtraFields=Attributs supplémentaires (Emplois) JobsExtraFields=Attributs supplémentaires (Job profile)
EvaluationsExtraFields=Attributs supplémentaires (Evaluations) EvaluationsExtraFields=Attributs supplémentaires (Evaluations)
NeedBusinessTravels=Need business travels NeedBusinessTravels=Need business travels
NoDescription=No description NoDescription=No description

View File

@ -29,7 +29,6 @@
*/ */
class Projects extends DolibarrApi class Projects extends DolibarrApi
{ {
/** /**
* @var array $FIELDS Mandatory fields, checked when create and update object * @var array $FIELDS Mandatory fields, checked when create and update object
*/ */
@ -267,10 +266,9 @@ class Projects extends DolibarrApi
* *
* @param int $id Id of project * @param int $id Id of project
* @param int $userid Id of user (0 = connected user) * @param int $userid Id of user (0 = connected user)
* @return array
* *
* @url GET {id}/roles * @url GET {id}/roles
*
* @return int
*/ */
public function getRoles($id, $userid = 0) public function getRoles($id, $userid = 0)
{ {
@ -301,6 +299,7 @@ class Projects extends DolibarrApi
foreach ($this->project->roles as $line) { foreach ($this->project->roles as $line) {
array_push($result, $this->_cleanObjectDatas($line)); array_push($result, $this->_cleanObjectDatas($line));
} }
return $result; return $result;
} }

View File

@ -1480,7 +1480,7 @@ class Project extends CommonObject
* @param int $list 0=Return array, 1=Return string list * @param int $list 0=Return array, 1=Return string list
* @param int $socid 0=No filter on third party, id of third party * @param int $socid 0=No filter on third party, id of third party
* @param string $filter additionnal filter on project (statut, ref, ...) * @param string $filter additionnal filter on project (statut, ref, ...)
* @return array or string Array of projects id, or string with projects id separated with "," if list is 1 * @return array|string Array of projects id, or string with projects id separated with "," if list is 1
*/ */
public function getProjectsAuthorizedForUser($user, $mode = 0, $list = 0, $socid = 0, $filter = '') public function getProjectsAuthorizedForUser($user, $mode = 0, $list = 0, $socid = 0, $filter = '')
{ {

View File

@ -88,6 +88,10 @@ $search_company = GETPOST('$search_company', 'alpha');
$search_company_alias = GETPOST('$search_company_alias', 'alpha'); $search_company_alias = GETPOST('$search_company_alias', 'alpha');
$search_project_ref = GETPOST('$search_project_ref', 'alpha'); $search_project_ref = GETPOST('$search_project_ref', 'alpha');
$search_project_label = GETPOST('$search_project_label', 'alpha'); $search_project_label = GETPOST('$search_project_label', 'alpha');
$search_timespent_starthour = GETPOSTINT("search_timespent_duration_starthour");
$search_timespent_startmin = GETPOSTINT("search_timespent_duration_startmin");
$search_timespent_endhour = GETPOSTINT("search_timespent_duration_endhour");
$search_timespent_endmin = GETPOSTINT("search_timespent_duration_endmin");
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
@ -196,6 +200,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_product_ref = ''; $search_product_ref = '';
$toselect = array(); $toselect = array();
$search_array_options = array(); $search_array_options = array();
$search_timespent_starthour = '';
$search_timespent_startmin = '';
$search_timespent_endhour = '';
$search_timespent_endmin = '';
$action = ''; $action = '';
} }
@ -1337,6 +1345,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if ($search_date_endyear) { if ($search_date_endyear) {
$param .= '&search_date_endyear='.urlencode($search_date_endyear); $param .= '&search_date_endyear='.urlencode($search_date_endyear);
} }
if ($search_timespent_starthour) {
$param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour);
}
if ($search_timespent_startmin) {
$param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin);
}
if ($search_timespent_endhour) {
$param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour);
}
if ($search_timespent_endmin) {
$param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin);
}
/* /*
// Add $param from extra fields // Add $param from extra fields
@ -1609,6 +1629,20 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$sql .= " AND t.task_date <= '".$db->idate($search_date_end)."'"; $sql .= " AND t.task_date <= '".$db->idate($search_date_end)."'";
} }
if (!empty($arrayfields['t.task_duration']['checked'])) {
if ($search_timespent_starthour || $search_timespent_startmin) {
$timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
$timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
$sql .= " AND t.task_duration >= " . $timespent_duration_start;
}
if ($search_timespent_endhour || $search_timespent_endmin) {
$timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
$timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
$sql .= " AND t.task_duration <= " . $timespent_duration_end;
}
}
$sql .= dolSqlDateFilter('t.task_datehour', $search_day, $search_month, $search_year); $sql .= dolSqlDateFilter('t.task_datehour', $search_day, $search_month, $search_year);
// Add where from hooks // Add where from hooks
@ -1877,7 +1911,26 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
} }
// Duration // Duration
if (!empty($arrayfields['t.task_duration']['checked'])) { if (!empty($arrayfields['t.task_duration']['checked'])) {
print '<td class="liste_titre right"></td>'; // Duration - Time spent
print '<td class="liste_titre right">';
$durationtouse_start = 0;
if ($search_timespent_starthour || $search_timespent_startmin) {
$durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
}
print '<div class="nowraponall">'.$langs->trans('from').'&nbsp;';
$form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text');
print '</div>';
$durationtouse_end = 0;
if ($search_timespent_endhour || $search_timespent_endmin) {
$durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
}
print '<div class="nowraponall">'.$langs->trans('at').'&nbsp;';
$form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text');
print '</div>';
print '</td>';
} }
// Product // Product
if (!empty($arrayfields['t.fk_product']['checked'])) { if (!empty($arrayfields['t.fk_product']['checked'])) {

View File

@ -2369,7 +2369,7 @@ class Ticket extends CommonObject
/** /**
* Add new message on a ticket (private/public area). * Add new message on a ticket (private/public area).
* Can also send it be email if GETPOST('send_email', 'int') is set. For such email, header and footer is added. * Can also send it by email if GETPOST('send_email', 'int') is set. For such email, header and footer is added.
* *
* @param User $user User for action * @param User $user User for action
* @param string $action Action string * @param string $action Action string
@ -2438,8 +2438,13 @@ class Ticket extends CommonObject
* Send emails to assigned users (public area notification) * Send emails to assigned users (public area notification)
*/ */
if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED)) { if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED)) {
// Retrieve internal contact datas
$internal_contacts = $object->getInfosTicketInternalContact();
$assigned_user_dont_have_email = ''; $assigned_user_dont_have_email = '';
$sendto = array(); $sendto = array();
if ($this->fk_user_assign > 0) { if ($this->fk_user_assign > 0) {
$assigned_user = new User($this->db); $assigned_user = new User($this->db);
$assigned_user->fetch($this->fk_user_assign); $assigned_user->fetch($this->fk_user_assign);
@ -2449,6 +2454,21 @@ class Ticket extends CommonObject
$assigned_user_dont_have_email = $assigned_user->getFullName($langs); $assigned_user_dont_have_email = $assigned_user->getFullName($langs);
} }
} }
// Build array to display recipient list
foreach ($internal_contacts as $key => $info_sendto) {
// Avoid duplicate notifications
if ($info_sendto['id'] == $user->id) {
continue;
}
if ($info_sendto['email'] != '') {
if (!empty($info_sendto['email'])) {
$sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">";
}
}
}
if (empty($sendto)) { if (empty($sendto)) {
if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL)) { if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL)) {
$sendto[] = $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL; $sendto[] = $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL;
@ -2545,7 +2565,7 @@ class Ticket extends CommonObject
if ($info_sendto['email'] != '') { if ($info_sendto['email'] != '') {
if (!empty($info_sendto['email'])) { if (!empty($info_sendto['email'])) {
$sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">"; $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">";
} }
// Contact type // Contact type

View File

@ -3489,7 +3489,7 @@ class User extends CommonObject
* *
* @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree. * @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree.
* @param string $filter SQL filter on users. This parameter must not come from user intput. * @param string $filter SQL filter on users. This parameter must not come from user intput.
* @return array Array of users $this->users. Note: $this->parentof is also set. * @return array|int Array of users $this->users. Note: $this->parentof is also set.
*/ */
public function get_full_tree($deleteafterid = 0, $filter = '') public function get_full_tree($deleteafterid = 0, $filter = '')
{ {

View File

@ -182,7 +182,7 @@ class UserGroup extends CommonObject
* *
* @param int $userid User id to search * @param int $userid User id to search
* @param boolean $load_members Load all members of the group * @param boolean $load_members Load all members of the group
* @return array Array of groups objects * @return array|int Array of groups objects
*/ */
public function listGroupsForUser($userid, $load_members = true) public function listGroupsForUser($userid, $load_members = true)
{ {
@ -544,7 +544,7 @@ class UserGroup extends CommonObject
* Charge dans l'objet group, la liste des permissions auquels le groupe a droit * Charge dans l'objet group, la liste des permissions auquels le groupe a droit
* *
* @param string $moduletag Name of module we want permissions ('' means all) * @param string $moduletag Name of module we want permissions ('' means all)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >=0 if OK
*/ */
public function getrights($moduletag = '') public function getrights($moduletag = '')
{ {
@ -552,12 +552,12 @@ class UserGroup extends CommonObject
if ($moduletag && isset($this->_tab_loaded[$moduletag]) && $this->_tab_loaded[$moduletag]) { if ($moduletag && isset($this->_tab_loaded[$moduletag]) && $this->_tab_loaded[$moduletag]) {
// Rights for this module are already loaded, so we leave // Rights for this module are already loaded, so we leave
return; return 0;
} }
if (!empty($this->all_permissions_are_loaded)) { if (!empty($this->all_permissions_are_loaded)) {
// We already loaded all rights for this group, so we leave // We already loaded all rights for this group, so we leave
return; return 0;
} }
/* /*