Merge branch 'Dolibarr:develop' into develop
This commit is contained in:
commit
fc3876474c
@ -927,4 +927,46 @@ class AdherentType extends CommonObject
|
||||
|
||||
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"> </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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -505,4 +505,36 @@ class Subscription extends CommonObject
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,6 +37,8 @@ $massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$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);
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
@ -253,6 +255,9 @@ llxHeader('', $title, $help_url);
|
||||
$i = 0;
|
||||
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .='&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
@ -298,6 +303,9 @@ if (in_array($massaction, array('presend', 'predelete'))) {
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
$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')) {
|
||||
$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="contextpage" value="'.$contextpage.'">';
|
||||
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);
|
||||
|
||||
@ -507,143 +517,166 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
$adherent->need_subscription = $adht->subscription;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr><td colspan="12">';
|
||||
print '<div class="box-flex-container">';
|
||||
}
|
||||
|
||||
// Ref
|
||||
if (!empty($arrayfields['d.ref']['checked'])) {
|
||||
print '<td>'.$subscription->getNomUrl(1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Type
|
||||
if (!empty($arrayfields['d.fk_type']['checked'])) {
|
||||
print '<td class="nowraponall">';
|
||||
if ($typeid > 0) {
|
||||
print $adht->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Lastname
|
||||
if (!empty($arrayfields['d.lastname']['checked'])) {
|
||||
print '<td class="tdoverflowmax150">'.$adherent->getNomUrl(-1, 0, 'card', 'lastname').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Firstname
|
||||
if (!empty($arrayfields['d.firstname']['checked'])) {
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->firstname).'">'.$adherent->firstname.'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Login
|
||||
if (!empty($arrayfields['d.login']['checked'])) {
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->login).'">'.$adherent->login.'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Label
|
||||
if (!empty($arrayfields['t.libelle']['checked'])) {
|
||||
print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note).'">';
|
||||
print $obj->note;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Banque
|
||||
if (!empty($arrayfields['d.bank']['checked'])) {
|
||||
print '<td class="tdmaxoverflow150">';
|
||||
//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);
|
||||
//$accountstatic->label=$obj->label;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
$subscription->fk_bank = $accountstatic->getNomUrl(1);
|
||||
}
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
// Output Kanban
|
||||
print $subscription->getKanbanView('');
|
||||
if ($i == (min($num, $limit) - 1)) {
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Date start
|
||||
if (!empty($arrayfields['c.dateadh']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->dateadh), 'day')."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
// Ref
|
||||
if (!empty($arrayfields['d.ref']['checked'])) {
|
||||
print '<td>'.$subscription->getNomUrl(1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Date end
|
||||
if (!empty($arrayfields['c.datef']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datef), 'day')."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
// Type
|
||||
if (!empty($arrayfields['d.fk_type']['checked'])) {
|
||||
print '<td class="nowraponall">';
|
||||
if ($typeid > 0) {
|
||||
print $adht->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Price
|
||||
if (!empty($arrayfields['d.amount']['checked'])) {
|
||||
print '<td class="right amount">'.price($obj->subscription).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
// Lastname
|
||||
if (!empty($arrayfields['d.lastname']['checked'])) {
|
||||
print '<td class="tdoverflowmax150">'.$adherent->getNomUrl(-1, 0, 'card', 'lastname').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'd.amount';
|
||||
// Firstname
|
||||
if (!empty($arrayfields['d.firstname']['checked'])) {
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->firstname).'">'.$adherent->firstname.'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (empty($totalarray['val']['d.amount'])) {
|
||||
$totalarray['val']['d.amount'] = $obj->subscription;
|
||||
} else {
|
||||
$totalarray['val']['d.amount'] += $obj->subscription;
|
||||
|
||||
// Login
|
||||
if (!empty($arrayfields['d.login']['checked'])) {
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($adherent->login).'">'.$adherent->login.'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Label
|
||||
if (!empty($arrayfields['t.libelle']['checked'])) {
|
||||
print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note).'">';
|
||||
print $obj->note;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Banque
|
||||
if (!empty($arrayfields['d.bank']['checked'])) {
|
||||
print '<td class="tdmaxoverflow150">';
|
||||
if ($obj->fk_account > 0) {
|
||||
$accountstatic->id = $obj->fk_account;
|
||||
$accountstatic->fetch($obj->fk_account);
|
||||
//$accountstatic->label=$obj->label;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Date start
|
||||
if (!empty($arrayfields['c.dateadh']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->dateadh), 'day')."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Date end
|
||||
if (!empty($arrayfields['c.datef']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datef), 'day')."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Price
|
||||
if (!empty($arrayfields['d.amount']['checked'])) {
|
||||
print '<td class="right amount">'.price($obj->subscription).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'd.amount';
|
||||
}
|
||||
if (empty($totalarray['val']['d.amount'])) {
|
||||
$totalarray['val']['d.amount'] = $obj->subscription;
|
||||
} else {
|
||||
$totalarray['val']['d.amount'] += $obj->subscription;
|
||||
}
|
||||
}
|
||||
// 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['c.datec']['checked'])) {
|
||||
print '<td class="nowrap center">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Date modification
|
||||
if (!empty($arrayfields['c.tms']['checked'])) {
|
||||
print '<td class="nowrap center">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Action column
|
||||
print '<td class="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->crowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->crowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
}
|
||||
// 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['c.datec']['checked'])) {
|
||||
print '<td class="nowrap center">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Date modification
|
||||
if (!empty($arrayfields['c.tms']['checked'])) {
|
||||
print '<td class="nowrap center">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Action column
|
||||
print '<td class="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->crowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->crowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -44,6 +44,7 @@ $action = GETPOST('action', 'aZ09');
|
||||
$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
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$mode = GETPOST('mode', 'alopha');
|
||||
|
||||
$sall = GETPOST("sall", "alpha");
|
||||
$filter = GETPOST("filter", 'alpha');
|
||||
@ -249,6 +250,9 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
$i = 0;
|
||||
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode'.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.$contextpage;
|
||||
}
|
||||
@ -257,6 +261,10 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
}
|
||||
|
||||
$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')) {
|
||||
$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="sortfield" value="'.$sortfield.'">';
|
||||
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);
|
||||
|
||||
@ -303,32 +313,47 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
$membertype->amount = $objp->amount;
|
||||
$membertype->caneditamount = $objp->caneditamount;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowraponall">';
|
||||
print $membertype->getNomUrl(1);
|
||||
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
|
||||
print '</td>';
|
||||
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
||||
print '<td class="center">';
|
||||
if ($objp->morphy == 'phy') {
|
||||
print $langs->trans("Physical");
|
||||
} elseif ($objp->morphy == 'mor') {
|
||||
print $langs->trans("Moral");
|
||||
|
||||
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 $langs->trans("MorAndPhy");
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowraponall">';
|
||||
print $membertype->getNomUrl(1);
|
||||
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
|
||||
print '</td>';
|
||||
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
||||
print '<td class="center">';
|
||||
if ($objp->morphy == 'phy') {
|
||||
print $langs->trans("Physical");
|
||||
} elseif ($objp->morphy == 'mor') {
|
||||
print $langs->trans("Moral");
|
||||
} else {
|
||||
print $langs->trans("MorAndPhy");
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
|
||||
print '<td class="center">'.yn($objp->caneditamount).'</td>';
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
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>';
|
||||
} else {
|
||||
print '<td class="right"> </td>';
|
||||
}
|
||||
print "</tr>";
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
|
||||
print '<td class="center">'.yn($objp->caneditamount).'</td>';
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
if ($user->hasRight('adherent', 'configurer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
} else {
|
||||
print '<td class="right"> </td>';
|
||||
}
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -372,13 +372,13 @@ if ($mode == 'feature') {
|
||||
if (count($objMod->depends)) {
|
||||
$text .= join(',', $objMod->depends);
|
||||
} else {
|
||||
$text .= $langs->trans("None");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>';
|
||||
}
|
||||
$text .= '<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
|
||||
if (count($objMod->requiredby)) {
|
||||
$text .= join(',', $objMod->requiredby);
|
||||
} else {
|
||||
$text .= $langs->trans("None");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br><br>';
|
||||
@ -395,7 +395,7 @@ if ($mode == 'feature') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -408,7 +408,7 @@ if ($mode == 'feature') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -418,7 +418,7 @@ if ($mode == 'feature') {
|
||||
if (dol_is_file($filedata)) {
|
||||
$text .= $langs->trans("Yes").' <span class="opacitymedium">('.$moduledir.'/sql/data.sql)</span>';
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -437,7 +437,7 @@ if ($mode == 'feature') {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -446,7 +446,7 @@ if ($mode == 'feature') {
|
||||
if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models']) {
|
||||
$text .= $langs->trans("Yes");
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -455,7 +455,7 @@ if ($mode == 'feature') {
|
||||
if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions']) {
|
||||
$text .= $langs->trans("Yes");
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -468,7 +468,7 @@ if ($mode == 'feature') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -502,7 +502,7 @@ if ($mode == 'feature') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -531,7 +531,7 @@ if ($mode == 'feature') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -544,7 +544,7 @@ if ($mode == 'feature') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$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
|
||||
$text .= $langs->trans("Yes");
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -566,7 +566,7 @@ if ($mode == 'feature') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
@ -579,13 +579,13 @@ if ($mode == 'feature') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$text .= $langs->trans("No");
|
||||
$text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
|
||||
}
|
||||
|
||||
$text .= '<br>';
|
||||
|
||||
$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) {
|
||||
$text .= '<div class="moduledesclong">'.$changelog.'<div>';
|
||||
} else {
|
||||
$text .= '<div class="moduledesclong">'.$langs->trans("NotAvailable").'</div>';
|
||||
$text .= '<div class="moduledesclong"><span class="opacitymedium">'.$langs->trans("NotAvailable").'</span></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -108,11 +108,11 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* Return an array with order informations
|
||||
*
|
||||
* @param int $id ID of order
|
||||
* @param int $id ID of order
|
||||
* @param string $ref Ref 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
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
|
||||
@ -122,8 +122,8 @@ class BankAccounts extends DolibarrApi
|
||||
/**
|
||||
* Get account by ID.
|
||||
*
|
||||
* @param int $id ID of account
|
||||
* @return array Account object
|
||||
* @param int $id ID of account
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
@ -313,9 +313,9 @@ class BankAccounts extends DolibarrApi
|
||||
/**
|
||||
* Update account
|
||||
*
|
||||
* @param int $id ID of account
|
||||
* @param array $request_data data
|
||||
* @return int
|
||||
* @param int $id ID of account
|
||||
* @param array $request_data data
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
|
||||
@ -271,7 +271,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer) {
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->supprimer) {
|
||||
$object->delete($user);
|
||||
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/facture/invoicetemplate_list.php');
|
||||
@ -1175,8 +1175,8 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Confirm delete of repeatable invoice
|
||||
if ($action == 'ask_deleteinvoice') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
|
||||
if ($action == 'delete') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_delete', '', 'no', 1);
|
||||
}
|
||||
|
||||
// Call Hook formConfirm
|
||||
|
||||
@ -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 int $fk_element Id of element
|
||||
* @return array Comment array
|
||||
* @return int Result
|
||||
*/
|
||||
public function fetchAllFor($element_type, $fk_element)
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
$this->comments = array();
|
||||
|
||||
if (!empty($element_type) && !empty($fk_element)) {
|
||||
$sql = "SELECT";
|
||||
$sql .= " c.rowid";
|
||||
|
||||
@ -198,9 +198,9 @@ class EvalMath
|
||||
}
|
||||
|
||||
/**
|
||||
* vars
|
||||
* Function vars
|
||||
*
|
||||
* @return string Output
|
||||
* @return array Output
|
||||
*/
|
||||
public function vars()
|
||||
{
|
||||
@ -211,9 +211,9 @@ class EvalMath
|
||||
}
|
||||
|
||||
/**
|
||||
* vars
|
||||
* Function funcs
|
||||
*
|
||||
* @return string Output
|
||||
* @return array Output
|
||||
*/
|
||||
private function funcs()
|
||||
{
|
||||
@ -229,8 +229,8 @@ class EvalMath
|
||||
/**
|
||||
* Convert infix to postfix notation
|
||||
*
|
||||
* @param string $expr Expression
|
||||
* @return string Output
|
||||
* @param string $expr Expression
|
||||
* @return boolean|array Output
|
||||
*/
|
||||
private function nfx($expr)
|
||||
{
|
||||
@ -367,6 +367,7 @@ class EvalMath
|
||||
}
|
||||
$output[] = $op;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
@ -779,7 +779,7 @@ class FormTicket
|
||||
* @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 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)
|
||||
{
|
||||
@ -985,7 +985,6 @@ class FormTicket
|
||||
}
|
||||
$sql = substr($sql, 0, -2);
|
||||
$sql .= ")";
|
||||
} else {
|
||||
}
|
||||
$sql .= $this->db->order('ctc.pos', 'ASC');
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@ class SimpleOpenID
|
||||
/**
|
||||
* SetOpenIDServer
|
||||
*
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function GetError()
|
||||
{
|
||||
@ -225,7 +225,7 @@ class SimpleOpenID
|
||||
* splitResponse
|
||||
*
|
||||
* @param string $response Server
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function splitResponse($response)
|
||||
{
|
||||
|
||||
@ -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).
|
||||
*
|
||||
* @return string The DB prefix
|
||||
|
||||
@ -907,7 +907,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
* @param Propal $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
* @return int
|
||||
*/
|
||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
|
||||
@ -744,7 +744,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
* @return int
|
||||
*/
|
||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
|
||||
@ -145,13 +145,12 @@ if ($result) {
|
||||
$establishmentstatic->label = $obj->label;
|
||||
$establishmentstatic->status = $obj->status;
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$establishmentstatic->getNomUrl(1).'</td>';
|
||||
print '<td>'.$obj->label.'</td>';
|
||||
print '<td class="left">'.$obj->address.'</td>';
|
||||
print '<td class="left">'.$obj->zip.'</td>';
|
||||
print '<td class="left">'.$obj->town.'</td>';
|
||||
print '<td>'.dol_escape_htmltag($obj->label).'</td>';
|
||||
print '<td>'.dol_escape_htmltag($obj->address).'</td>';
|
||||
print '<td>'.dol_escape_htmltag($obj->zip).'</td>';
|
||||
print '<td>'.dol_escape_htmltag($obj->town).'</td>';
|
||||
print '<td class="right">';
|
||||
print $establishmentstatic->getLibStatut(5);
|
||||
print '</td>';
|
||||
@ -160,7 +159,7 @@ if ($result) {
|
||||
$i++;
|
||||
}
|
||||
} 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>';
|
||||
|
||||
@ -86,7 +86,7 @@ SaveAddSkill = Skill(s) added
|
||||
SaveLevelSkill = Skill(s) level saved
|
||||
DeleteSkill = Skill removed
|
||||
SkillsExtraFields=Attributs supplémentaires (Compétences)
|
||||
JobsExtraFields=Attributs supplémentaires (Emplois)
|
||||
JobsExtraFields=Attributs supplémentaires (Job profile)
|
||||
EvaluationsExtraFields=Attributs supplémentaires (Evaluations)
|
||||
NeedBusinessTravels=Need business travels
|
||||
NoDescription=No description
|
||||
@ -29,7 +29,6 @@
|
||||
*/
|
||||
class Projects extends DolibarrApi
|
||||
{
|
||||
|
||||
/**
|
||||
* @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 $userid Id of user (0 = connected user)
|
||||
* @return array
|
||||
*
|
||||
* @url GET {id}/roles
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRoles($id, $userid = 0)
|
||||
{
|
||||
@ -301,6 +299,7 @@ class Projects extends DolibarrApi
|
||||
foreach ($this->project->roles as $line) {
|
||||
array_push($result, $this->_cleanObjectDatas($line));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -1480,7 +1480,7 @@ class Project extends CommonObject
|
||||
* @param int $list 0=Return array, 1=Return string list
|
||||
* @param int $socid 0=No filter on third party, id of third party
|
||||
* @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 = '')
|
||||
{
|
||||
|
||||
@ -88,6 +88,10 @@ $search_company = GETPOST('$search_company', 'alpha');
|
||||
$search_company_alias = GETPOST('$search_company_alias', 'alpha');
|
||||
$search_project_ref = GETPOST('$search_project_ref', '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;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@ -196,6 +200,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
$search_product_ref = '';
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
$search_timespent_starthour = '';
|
||||
$search_timespent_startmin = '';
|
||||
$search_timespent_endhour = '';
|
||||
$search_timespent_endmin = '';
|
||||
$action = '';
|
||||
}
|
||||
|
||||
@ -1337,6 +1345,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
if ($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
|
||||
@ -1609,6 +1629,20 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
$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);
|
||||
|
||||
// Add where from hooks
|
||||
@ -1877,7 +1911,26 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
}
|
||||
// Duration
|
||||
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').' ';
|
||||
$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').' ';
|
||||
$form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text');
|
||||
print '</div>';
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
// Product
|
||||
if (!empty($arrayfields['t.fk_product']['checked'])) {
|
||||
|
||||
@ -2369,7 +2369,7 @@ class Ticket extends CommonObject
|
||||
|
||||
/**
|
||||
* 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 string $action Action string
|
||||
@ -2438,8 +2438,13 @@ class Ticket extends CommonObject
|
||||
* Send emails to assigned users (public area notification)
|
||||
*/
|
||||
if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED)) {
|
||||
// Retrieve internal contact datas
|
||||
$internal_contacts = $object->getInfosTicketInternalContact();
|
||||
|
||||
$assigned_user_dont_have_email = '';
|
||||
|
||||
$sendto = array();
|
||||
|
||||
if ($this->fk_user_assign > 0) {
|
||||
$assigned_user = new User($this->db);
|
||||
$assigned_user->fetch($this->fk_user_assign);
|
||||
@ -2449,6 +2454,21 @@ class Ticket extends CommonObject
|
||||
$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($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 (!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
|
||||
|
||||
@ -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 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 = '')
|
||||
{
|
||||
|
||||
@ -180,9 +180,9 @@ class UserGroup extends CommonObject
|
||||
/**
|
||||
* Return array of groups objects for a particular user
|
||||
*
|
||||
* @param int $userid User id to search
|
||||
* @param boolean $load_members Load all members of the group
|
||||
* @return array Array of groups objects
|
||||
* @param int $userid User id to search
|
||||
* @param boolean $load_members Load all members of the group
|
||||
* @return array|int Array of groups objects
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @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 = '')
|
||||
{
|
||||
@ -552,12 +552,12 @@ class UserGroup extends CommonObject
|
||||
|
||||
if ($moduletag && isset($this->_tab_loaded[$moduletag]) && $this->_tab_loaded[$moduletag]) {
|
||||
// Rights for this module are already loaded, so we leave
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!empty($this->all_permissions_are_loaded)) {
|
||||
// We already loaded all rights for this group, so we leave
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user