commit
0c20b6b2d6
@ -86,13 +86,14 @@ class Members extends DolibarrApi
|
|||||||
* @param int $limit Limit for list
|
* @param int $limit Limit for list
|
||||||
* @param int $page Page number
|
* @param int $page Page number
|
||||||
* @param string $typeid ID of the type of member
|
* @param string $typeid ID of the type of member
|
||||||
|
* @param int $category Use this param to filter list by category
|
||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma.
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma.
|
||||||
* Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))"
|
* Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))"
|
||||||
* @return array Array of member objects
|
* @return array Array of member objects
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '')
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $category = 0, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
@ -104,11 +105,19 @@ class Members extends DolibarrApi
|
|||||||
|
|
||||||
$sql = "SELECT t.rowid";
|
$sql = "SELECT t.rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as t";
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie_member as c";
|
||||||
|
}
|
||||||
$sql .= ' WHERE t.entity IN ('.getEntity('adherent').')';
|
$sql .= ' WHERE t.entity IN ('.getEntity('adherent').')';
|
||||||
if (!empty($typeid))
|
if (!empty($typeid))
|
||||||
{
|
{
|
||||||
$sql .= ' AND t.fk_adherent_type='.$typeid;
|
$sql .= ' AND t.fk_adherent_type='.$typeid;
|
||||||
}
|
}
|
||||||
|
// Select members of given category
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= " AND c.fk_categorie = ".$db->escape($category);
|
||||||
|
$sql .= " AND c.fk_member = t.rowid ";
|
||||||
|
}
|
||||||
// Add sql filters
|
// Add sql filters
|
||||||
if ($sqlfilters)
|
if ($sqlfilters)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -195,7 +195,7 @@ dol_fiche_end();
|
|||||||
* Projects Numbering model
|
* Projects Numbering model
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("TicketNumberingModules"));
|
print load_fiche_titre($langs->trans("TicketNumberingModules"), '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
@ -298,7 +298,7 @@ if (!$conf->use_javascript_ajax) {
|
|||||||
print '<input type="hidden" name="action" value="setvarother">';
|
print '<input type="hidden" name="action" value="setvarother">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("TicketParams"));
|
print load_fiche_titre($langs->trans("Other"), '', '');
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -307,78 +307,6 @@ print '<td></td>';
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Activate email notifications
|
|
||||||
/*
|
|
||||||
print '<tr class="pair"><td>' . $langs->trans("TicketsDisableEmail") . '</td>';
|
|
||||||
print '<td class="left">';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('TICKET_DISABLE_ALL_MAILS');
|
|
||||||
} else {
|
|
||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
||||||
print $form->selectarray("TICKET_DISABLE_ALL_MAILS", $arrval, $conf->global->TICKET_DISABLE_ALL_MAILS);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Activate log by email
|
|
||||||
print '<tr class="pair"><td>' . $langs->trans("TicketsLogEnableEmail") . '</td>';
|
|
||||||
print '<td class="left">';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('TICKET_ACTIVATE_LOG_BY_EMAIL');
|
|
||||||
} else {
|
|
||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
||||||
print $form->selectarray("TICKET_ACTIVATE_LOG_BY_EMAIL", $arrval, $conf->global->TICKET_ACTIVATE_LOG_BY_EMAIL);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketsLogEnableEmailHelp"), 1, 'help');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Also send to main email address
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|
||||||
{
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
|
|
||||||
print '<td class="left">';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
|
|
||||||
} else {
|
|
||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
||||||
print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Limiter la vue des tickets à ceux assignés à l'utilisateur
|
|
||||||
/*
|
|
||||||
print '<tr class="pair"><td>' . $langs->trans("TicketsLimitViewAssignedOnly") . '</td>';
|
|
||||||
print '<td class="left">';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('TICKET_LIMIT_VIEW_ASSIGNED_ONLY');
|
|
||||||
} else {
|
|
||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
||||||
print $form->selectarray("TICKET_LIMIT_VIEW_ASSIGNED_ONLY", $arrval, $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketsLimitViewAssignedOnlyHelp"), 1, 'help');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*if (!$conf->use_javascript_ajax) {
|
|
||||||
print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Auto assign ticket at user who created it
|
// Auto assign ticket at user who created it
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoAssignTicket").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoAssignTicket").'</td>';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
@ -401,7 +329,7 @@ if (!$conf->use_javascript_ajax) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Admin var of module
|
// Admin var of module
|
||||||
print load_fiche_titre($langs->trans("Notification"));
|
print load_fiche_titre($langs->trans("Notification"), '', '');
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
@ -419,22 +347,6 @@ if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activate log by email
|
|
||||||
/*print '<tr class="pair"><td>' . $langs->trans("TicketsLogEnableEmail") . '</td>';
|
|
||||||
print '<td class="left">';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('TICKET_ACTIVATE_LOG_BY_EMAIL');
|
|
||||||
} else {
|
|
||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
||||||
print $form->selectarray("TICKET_ACTIVATE_LOG_BY_EMAIL", $arrval, $conf->global->TICKET_ACTIVATE_LOG_BY_EMAIL);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketsLogEnableEmailHelp"), 1, 'help');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// @todo Use module notification instead...
|
// @todo Use module notification instead...
|
||||||
|
|
||||||
// Email d'envoi des notifications
|
// Email d'envoi des notifications
|
||||||
@ -446,18 +358,36 @@ print $form->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"),
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Email de réception des notifications
|
// Email for notification of TICKET_CREATE
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationTo").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationTo").' ('.$langs->trans("Creation").')</td>';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
print '<input type="text" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : $conf->global->TICKET_NOTIFICATION_EMAIL_FROM).'" size="20" ></td>';
|
print '<input type="text" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : '').'"></td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help');
|
print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Also send to TICKET_NOTIFICATION_EMAIL_TO for responses (not only creation)
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
|
||||||
|
print '<td class="left">';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
|
||||||
|
} else {
|
||||||
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
|
print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help');
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Texte d'introduction
|
// Texte d'introduction
|
||||||
$mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_MESSAGE_MAIL_INTRO : $langs->trans('TicketMessageMailIntroText');
|
$mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_MESSAGE_MAIL_INTRO : $langs->trans('TicketMessageMailIntroText');
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailIntroLabelAdmin").'</label>';
|
print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailIntroLabelAdmin").' ('.$langs->trans("Responses").')';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
||||||
|
|||||||
@ -57,12 +57,13 @@ class BankAccounts extends DolibarrApi
|
|||||||
* @param string $sortorder Sort order
|
* @param string $sortorder Sort order
|
||||||
* @param int $limit Limit for list
|
* @param int $limit Limit for list
|
||||||
* @param int $page Page number
|
* @param int $page Page number
|
||||||
|
* @param int $category Use this param to filter list by category
|
||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')"
|
||||||
* @return array List of account objects
|
* @return array List of account objects
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
@ -71,7 +72,14 @@ class BankAccounts extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t";
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie_account as c";
|
||||||
|
}
|
||||||
$sql .= ' WHERE t.entity IN ('.getEntity('bank_account').')';
|
$sql .= ' WHERE t.entity IN ('.getEntity('bank_account').')';
|
||||||
|
// Select accounts of given category
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_account = t.rowid ";
|
||||||
|
}
|
||||||
// Add sql filters
|
// Add sql filters
|
||||||
if ($sqlfilters)
|
if ($sqlfilters)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -75,6 +75,8 @@ if ($action == 'add' && !empty($permissiontoadd))
|
|||||||
$value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int');
|
$value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int');
|
||||||
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
||||||
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
||||||
|
} elseif ($object->fields[$key]['type'] == 'boolean') {
|
||||||
|
$value = (GETPOST($key) == 'on' ? 1 : 0);
|
||||||
} else {
|
} else {
|
||||||
$value = GETPOST($key, 'alphanohtml');
|
$value = GETPOST($key, 'alphanohtml');
|
||||||
}
|
}
|
||||||
@ -156,6 +158,8 @@ if ($action == 'update' && !empty($permissiontoadd))
|
|||||||
}
|
}
|
||||||
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
||||||
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
||||||
|
} elseif ($object->fields[$key]['type'] == 'boolean') {
|
||||||
|
$value = (GETPOST($key) == 'on' ? 1 : 0);
|
||||||
} else {
|
} else {
|
||||||
$value = GETPOST($key, 'alpha');
|
$value = GETPOST($key, 'alpha');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -386,6 +387,12 @@ abstract class CommonDocGenerator
|
|||||||
$sumcreditnote = $object->getSumCreditNotesUsed();
|
$sumcreditnote = $object->getSumCreditNotesUsed();
|
||||||
$already_payed_all = $sumpayed + $sumdeposit + $sumcreditnote;
|
$already_payed_all = $sumpayed + $sumdeposit + $sumcreditnote;
|
||||||
$remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote;
|
$remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote;
|
||||||
|
|
||||||
|
if ($object->fk_account > 0) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php';
|
||||||
|
$bank_account = new Account($this->db);
|
||||||
|
$bank_account->fetch($object->fk_account);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = ($object->element == 'contrat' ? $object->date_contrat : $object->date);
|
$date = ($object->element == 'contrat' ? $object->date_contrat : $object->date);
|
||||||
@ -414,6 +421,9 @@ abstract class CommonDocGenerator
|
|||||||
$array_key.'_payment_term_code'=>$object->cond_reglement_code,
|
$array_key.'_payment_term_code'=>$object->cond_reglement_code,
|
||||||
$array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)),
|
$array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)),
|
||||||
|
|
||||||
|
$array_key.'_bank_iban'=>$bank_account->iban,
|
||||||
|
$array_key.'_bank_bic'=>$bank_account->bic,
|
||||||
|
|
||||||
$array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs),
|
$array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs),
|
||||||
$array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
|
$array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
|
||||||
$array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs),
|
$array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs),
|
||||||
|
|||||||
@ -318,7 +318,7 @@ class FormProjets
|
|||||||
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
|
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
|
||||||
* @param string $showproject 'all' = Show project info, ''=Hide project info
|
* @param string $showproject 'all' = Show project info, ''=Hide project info
|
||||||
* @param User $usertofilter User object to use for filtering
|
* @param User $usertofilter User object to use for filtering
|
||||||
* @return int Nbr of project if OK, <0 if KO
|
* @return int Nbr of tasks if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
public function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
|
public function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -34,7 +34,6 @@ if (!class_exists('FormCompany')) {
|
|||||||
* Classe permettant la generation du formulaire d'un nouveau ticket.
|
* Classe permettant la generation du formulaire d'un nouveau ticket.
|
||||||
*
|
*
|
||||||
* @package Ticket
|
* @package Ticket
|
||||||
|
|
||||||
* \remarks Utilisation: $formticket = new FormTicket($db)
|
* \remarks Utilisation: $formticket = new FormTicket($db)
|
||||||
* \remarks $formticket->proprietes=1 ou chaine ou tableau de valeurs
|
* \remarks $formticket->proprietes=1 ou chaine ou tableau de valeurs
|
||||||
* \remarks $formticket->show_form() affiche le formulaire
|
* \remarks $formticket->show_form() affiche le formulaire
|
||||||
@ -354,7 +353,7 @@ class FormTicket
|
|||||||
{
|
{
|
||||||
$formproject = new FormProjets($this->db);
|
$formproject = new FormProjets($this->db);
|
||||||
print '<tr><td><label for="project"><span class="">'.$langs->trans("Project").'</span></label></td><td>';
|
print '<tr><td><label for="project"><span class="">'.$langs->trans("Project").'</span></label></td><td>';
|
||||||
print $formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1);
|
print $formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Define size of logo small and mini
|
// Define size of logo small and mini
|
||||||
$maxwidthsmall = 270; $maxheightsmall = 150;
|
$maxwidthsmall = 350; $maxheightsmall = 200; // Near 16/9eme
|
||||||
$maxwidthmini = 128; $maxheightmini = 72;
|
$maxwidthmini = 128; $maxheightmini = 72; // 16/9eme
|
||||||
$quality = 80;
|
$quality = 80;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -333,7 +333,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
|
|||||||
* @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category") or Array of WebsitePage
|
* @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category") or Array of WebsitePage
|
||||||
* @param string $outputfile Output file
|
* @param string $outputfile Output file
|
||||||
* @param string $filter (optional) Filter
|
* @param string $filter (optional) Filter
|
||||||
* @param string $url Url
|
* @param string $url Url (If empty, forge URL for agenda RSS export)
|
||||||
* @return int < 0 if ko, Nb of events in file if ok
|
* @return int < 0 if ko, Nb of events in file if ok
|
||||||
*/
|
*/
|
||||||
function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filter = '', $url = '')
|
function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filter = '', $url = '')
|
||||||
@ -402,9 +402,10 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
|
|||||||
$tmpevent['uid'] = $event->id;
|
$tmpevent['uid'] = $event->id;
|
||||||
$tmpevent['startdate'] = $event->date_creation;
|
$tmpevent['startdate'] = $event->date_creation;
|
||||||
$tmpevent['summary'] = $event->title;
|
$tmpevent['summary'] = $event->title;
|
||||||
$tmpevent['url'] = $event->urlpage.'.php';
|
$tmpevent['url'] = $event->fullpageurl ? $event->fullpageurl : $event->pageurl.'.php';
|
||||||
$tmpevent['author'] = $event->author_alias ? $event->author_alias : 'unknown';
|
$tmpevent['author'] = $event->author_alias ? $event->author_alias : 'unknown';
|
||||||
//$tmpevent['category'] = '';
|
//$tmpevent['category'] = '';
|
||||||
|
$tmpevent['desc'] = $event->description;
|
||||||
|
|
||||||
$event = $tmpevent;
|
$event = $tmpevent;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -375,6 +375,23 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
|
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name));
|
||||||
if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||||
|
|
||||||
|
// Set certificate
|
||||||
|
$cert = empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT;
|
||||||
|
// If use has no certificate, we try to take the company one
|
||||||
|
if (!$cert) {
|
||||||
|
$cert = empty($conf->global->CERTIFICATE_CRT) ? '' : $conf->global->CERTIFICATE_CRT;
|
||||||
|
}
|
||||||
|
// If a certificate is found
|
||||||
|
if ($cert) {
|
||||||
|
$info = array(
|
||||||
|
'Name' => $this->emetteur->name,
|
||||||
|
'Location' => getCountry($this->emetteur->country_code, 0),
|
||||||
|
'Reason' => 'INVOICE',
|
||||||
|
'ContactInfo' => $this->emetteur->email
|
||||||
|
);
|
||||||
|
$pdf->setSignature($cert, $cert, $this->emetteur->name, '', 2, $info);
|
||||||
|
}
|
||||||
|
|
||||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||||
|
|
||||||
// Does we have at least one line with discount $this->atleastonediscount
|
// Does we have at least one line with discount $this->atleastonediscount
|
||||||
@ -768,7 +785,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$reshook = $hookmanager->executeHooks('printPDFline', $parameters, $this); // Note that $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printPDFline', $parameters, $this); // Note that $object may have been modified by hook
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$sign = 1;
|
$sign = 1;
|
||||||
if (isset($object->type) && $object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign = -1;
|
if (isset($object->type) && $object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign = -1;
|
||||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
||||||
@ -1249,7 +1265,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
*/
|
*/
|
||||||
protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc, $hookmanager;
|
||||||
|
|
||||||
$sign = 1;
|
$sign = 1;
|
||||||
if ($object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign = -1;
|
if ($object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign = -1;
|
||||||
@ -1278,16 +1294,22 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add trigger to allow to edit $object
|
||||||
|
$parameters = array(
|
||||||
|
'object' => &$object,
|
||||||
|
'outputlangs' => $outputlangs,
|
||||||
|
);
|
||||||
|
$hookmanager->executeHooks('beforePercentCalculation', $parameters, $this); // Note that $object may have been modified by hook
|
||||||
|
|
||||||
// overall percentage of advancement
|
// overall percentage of advancement
|
||||||
$percent = 0;
|
$percent = 0;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($object->lines as $line)
|
foreach ($object->lines as $line)
|
||||||
{
|
{
|
||||||
if (!class_exists('TSubtotal') || !TSubtotal::isModSubtotalLine($line)) {
|
|
||||||
$percent += $line->situation_percent;
|
$percent += $line->situation_percent;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!empty($i)) {
|
if (!empty($i)) {
|
||||||
$avancementGlobal = $percent / $i;
|
$avancementGlobal = $percent / $i;
|
||||||
}
|
}
|
||||||
@ -1316,7 +1338,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$total_a_payer_ttc = 0;
|
$total_a_payer_ttc = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$deja_paye = 0;
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
if (!empty($TPreviousIncoice)) {
|
if (!empty($TPreviousIncoice)) {
|
||||||
$pdf->setY($tab2_top);
|
$pdf->setY($tab2_top);
|
||||||
@ -1348,7 +1369,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->MultiCell($largcol2, $tab2_hl, $displayAmount, 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, $displayAmount, 0, 'R', 1);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$deja_paye += $fac->total_ht;
|
|
||||||
$posy += $tab2_hl;
|
$posy += $tab2_hl;
|
||||||
|
|
||||||
$pdf->setY($posy);
|
$pdf->setY($posy);
|
||||||
@ -1675,7 +1695,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities('SituationTotalRayToRest'), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities('SituationTotalRayToRest'), 0, 'L', 1);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_a_payer_ttc-$deja_paye, 0, $outputlangs), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_a_payer_ttc-$deja_regle, 0, $outputlangs), 0, 'R', 1);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -451,6 +451,7 @@ class modSociete extends DolibarrModules
|
|||||||
's.fk_multicurrency' => 'MulticurrencyUsed',
|
's.fk_multicurrency' => 'MulticurrencyUsed',
|
||||||
's.multicurrency_code' => 'MulticurrencyCurrency'
|
's.multicurrency_code' => 'MulticurrencyCurrency'
|
||||||
);
|
);
|
||||||
|
if (! empty($conf->global->PRODUIT_MULTIPRICES)) $this->import_fields_array[$r]['s.price_level']='PriceLevel';
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@ -89,7 +89,7 @@ if ($permission)
|
|||||||
if (empty($hideaddcontactforuser))
|
if (empty($hideaddcontactforuser))
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<form class="tagtr impair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
|
<form class="tagtr impair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
|
||||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||||
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
|
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
|
||||||
<input type="hidden" name="action" value="addcontact" />
|
<input type="hidden" name="action" value="addcontact" />
|
||||||
@ -115,7 +115,7 @@ if ($permission)
|
|||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form class="tagtr pair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
|
<form class="tagtr pair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
|
||||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||||
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
|
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
|
||||||
<input type="hidden" name="action" value="addcontact" />
|
<input type="hidden" name="action" value="addcontact" />
|
||||||
|
|||||||
@ -188,11 +188,9 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
|
|
||||||
|
|
||||||
// Send email to notification email
|
// Send email to notification email
|
||||||
|
$sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail']))
|
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail']))
|
||||||
{
|
{
|
||||||
$sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
|
||||||
|
|
||||||
if ($sendto)
|
if ($sendto)
|
||||||
{
|
{
|
||||||
// Init to avoid errors
|
// Init to avoid errors
|
||||||
|
|||||||
@ -2553,7 +2553,7 @@ elseif ($id || $ref)
|
|||||||
|
|
||||||
// This is just to generate a delivery receipt
|
// This is just to generate a delivery receipt
|
||||||
//var_dump($object->linkedObjectsIds['delivery']);
|
//var_dump($object->linkedObjectsIds['delivery']);
|
||||||
if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
|
if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery']))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ GraphInBarsAreLimitedToNMeasures=Grapics are limited to %s measures in 'Bars' mo
|
|||||||
OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Only the first selected field has been selected.
|
OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Only the first selected field has been selected.
|
||||||
AtLeastOneMeasureIsRequired=At least 1 field for measure is required
|
AtLeastOneMeasureIsRequired=At least 1 field for measure is required
|
||||||
AtLeastOneXAxisIsRequired=At least 1 field for X-Axis is required
|
AtLeastOneXAxisIsRequired=At least 1 field for X-Axis is required
|
||||||
|
LatestBlogPosts=Latest Blog Posts
|
||||||
Notify_ORDER_VALIDATE=Sales order validated
|
Notify_ORDER_VALIDATE=Sales order validated
|
||||||
Notify_ORDER_SENTBYMAIL=Sales order sent by mail
|
Notify_ORDER_SENTBYMAIL=Sales order sent by mail
|
||||||
Notify_ORDER_SUPPLIER_SENTBYMAIL=Purchase order sent by email
|
Notify_ORDER_SUPPLIER_SENTBYMAIL=Purchase order sent by email
|
||||||
|
|||||||
@ -186,7 +186,7 @@ PlannedWorkload=Planned workload
|
|||||||
PlannedWorkloadShort=Workload
|
PlannedWorkloadShort=Workload
|
||||||
ProjectReferers=Related items
|
ProjectReferers=Related items
|
||||||
ProjectMustBeValidatedFirst=Project must be validated first
|
ProjectMustBeValidatedFirst=Project must be validated first
|
||||||
FirstAddRessourceToAllocateTime=Assign a user resource to task to allocate time
|
FirstAddRessourceToAllocateTime=Assign a user resource as contact of project to allocate time
|
||||||
InputPerDay=Input per day
|
InputPerDay=Input per day
|
||||||
InputPerWeek=Input per week
|
InputPerWeek=Input per week
|
||||||
InputPerMonth=Input per month
|
InputPerMonth=Input per month
|
||||||
|
|||||||
@ -113,3 +113,5 @@ CantDisableYourself=You can't disable your own user record
|
|||||||
ForceUserExpenseValidator=Force expense report validator
|
ForceUserExpenseValidator=Force expense report validator
|
||||||
ForceUserHolidayValidator=Force leave request validator
|
ForceUserHolidayValidator=Force leave request validator
|
||||||
ValidatorIsSupervisorByDefault=By default, the validator is the supervisor of the user. Keep empty to keep this behaviour.
|
ValidatorIsSupervisorByDefault=By default, the validator is the supervisor of the user. Keep empty to keep this behaviour.
|
||||||
|
UserPersonalEmail=Personal email
|
||||||
|
UserPersonalMobile=Personal mobile phone
|
||||||
|
|||||||
@ -70,8 +70,8 @@ if ($cancel) $action ='';
|
|||||||
if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->service->creer))
|
if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
var_dump(GETPOST("max_prod", 'int'));
|
$maxprod = GETPOST("max_prod", 'int');
|
||||||
for ($i=0; $i < GETPOST("max_prod", 'int'); $i++)
|
for ($i=0; $i < $maxprod; $i++)
|
||||||
{
|
{
|
||||||
$qty = price2num(GETPOST("prod_qty_".$i, 'alpha'), 'MS');
|
$qty = price2num(GETPOST("prod_qty_".$i, 'alpha'), 'MS');
|
||||||
if ($qty > 0)
|
if ($qty > 0)
|
||||||
|
|||||||
@ -87,12 +87,13 @@ class Warehouses extends DolibarrApi
|
|||||||
* @param string $sortorder Sort order
|
* @param string $sortorder Sort order
|
||||||
* @param int $limit Limit for list
|
* @param int $limit Limit for list
|
||||||
* @param int $page Page number
|
* @param int $page Page number
|
||||||
|
* @param int $category Use this param to filter list by category
|
||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'WH-%') and (t.date_creation:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'WH-%') and (t.date_creation:<:'20160101')"
|
||||||
* @return array Array of warehouse objects
|
* @return array Array of warehouse objects
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
@ -104,7 +105,15 @@ class Warehouses extends DolibarrApi
|
|||||||
|
|
||||||
$sql = "SELECT t.rowid";
|
$sql = "SELECT t.rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as t";
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie_societe as c";
|
||||||
|
}
|
||||||
$sql .= ' WHERE t.entity IN ('.getEntity('stock').')';
|
$sql .= ' WHERE t.entity IN ('.getEntity('stock').')';
|
||||||
|
// Select warehouses of given category
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= " AND c.fk_categorie = ".$db->escape($category);
|
||||||
|
$sql .= " AND c.fk_warehouse = t.rowid ";
|
||||||
|
}
|
||||||
// Add sql filters
|
// Add sql filters
|
||||||
if ($sqlfilters)
|
if ($sqlfilters)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -95,10 +95,11 @@ class Projects extends DolibarrApi
|
|||||||
* @param int $limit Limit for list
|
* @param int $limit Limit for list
|
||||||
* @param int $page Page number
|
* @param int $page Page number
|
||||||
* @param string $thirdparty_ids Thirdparty ids to filter projects of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
* @param string $thirdparty_ids Thirdparty ids to filter projects of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||||
|
* @param int $category Use this param to filter list by category
|
||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||||
* @return array Array of project objects
|
* @return array Array of project objects
|
||||||
*/
|
*/
|
||||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $category = 0, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
@ -114,7 +115,9 @@ class Projects extends DolibarrApi
|
|||||||
$sql = "SELECT t.rowid";
|
$sql = "SELECT t.rowid";
|
||||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."projet as t";
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie_project as c";
|
||||||
|
}
|
||||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||||
|
|
||||||
$sql .= ' WHERE t.entity IN ('.getEntity('project').')';
|
$sql .= ' WHERE t.entity IN ('.getEntity('project').')';
|
||||||
@ -126,6 +129,10 @@ class Projects extends DolibarrApi
|
|||||||
{
|
{
|
||||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||||
}
|
}
|
||||||
|
// Select projects of given category
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_project = t.rowid ";
|
||||||
|
}
|
||||||
// Add sql filters
|
// Add sql filters
|
||||||
if ($sqlfilters)
|
if ($sqlfilters)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -131,6 +131,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -358,7 +359,7 @@ if ($id > 0 || !empty($ref))
|
|||||||
$head = project_prepare_head($object);
|
$head = project_prepare_head($object);
|
||||||
dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project'));
|
dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project'));
|
||||||
|
|
||||||
$param = 'id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($search_user_id) $param .= '&search_user_id='.urlencode($search_user_id);
|
if ($search_user_id) $param .= '&search_user_id='.urlencode($search_user_id);
|
||||||
if ($search_taskref) $param .= '&search_taskref='.urlencode($search_taskref);
|
if ($search_taskref) $param .= '&search_taskref='.urlencode($search_taskref);
|
||||||
@ -634,7 +635,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
|
$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
@ -686,7 +687,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table id="tablelines" class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">';
|
print '<table id="tablelines" class="tagtable nobottom liste'.($moreforfilter ? " listwithfilterbefore" : "").'">';
|
||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
|
|||||||
@ -374,7 +374,7 @@ if ($id > 0 || !empty($ref))
|
|||||||
if ($action != 'editline' && $user->rights->projet->creer)
|
if ($action != 'editline' && $user->rights->projet->creer)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Nature").'</td>';
|
print '<td>'.$langs->trans("NatureOfContact").'</td>';
|
||||||
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||||
print '<td>'.$langs->trans("Users").'</td>';
|
print '<td>'.$langs->trans("Users").'</td>';
|
||||||
print '<td>'.$langs->trans("ContactType").'</td>';
|
print '<td>'.$langs->trans("ContactType").'</td>';
|
||||||
@ -389,7 +389,7 @@ if ($id > 0 || !empty($ref))
|
|||||||
if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
||||||
|
|
||||||
// Ligne ajout pour contact interne
|
// Ligne ajout pour contact interne
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven nohover">';
|
||||||
|
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print img_object('', 'user').' '.$langs->trans("Users");
|
print img_object('', 'user').' '.$langs->trans("Users");
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2006-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
@ -53,6 +53,7 @@ $projectid = GETPOST('projectid', 'int');
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$withproject = GETPOST('withproject', 'int');
|
$withproject = GETPOST('withproject', 'int');
|
||||||
$project_ref = GETPOST('project_ref', 'alpha');
|
$project_ref = GETPOST('project_ref', 'alpha');
|
||||||
|
$tab = GETPOST('tab', 'aZ09');
|
||||||
|
|
||||||
$search_day = GETPOST('search_day', 'int');
|
$search_day = GETPOST('search_day', 'int');
|
||||||
$search_month = GETPOST('search_month', 'int');
|
$search_month = GETPOST('search_month', 'int');
|
||||||
@ -620,8 +621,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
if ($withproject)
|
if ($withproject)
|
||||||
{
|
{
|
||||||
// Tabs for project
|
// Tabs for project
|
||||||
if (empty($id)) $tab = 'timespent';
|
if (empty($id) || $tab == 'timespent') $tab = 'timespent';
|
||||||
else $tab = 'tasks';
|
else $tab = 'tasks';
|
||||||
|
|
||||||
$head = project_prepare_head($projectstatic);
|
$head = project_prepare_head($projectstatic);
|
||||||
dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'));
|
dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'));
|
||||||
|
|
||||||
@ -958,6 +960,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
|
print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">';
|
||||||
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
||||||
|
print '<input type="hidden" name="tab" value="'.$tab.'">';
|
||||||
|
|
||||||
if ($massaction == 'generateinvoice')
|
if ($massaction == 'generateinvoice')
|
||||||
{
|
{
|
||||||
@ -1139,7 +1142,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven nohover">';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<td class="maxwidthonsmartphone">';
|
print '<td class="maxwidthonsmartphone">';
|
||||||
@ -1149,19 +1152,20 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Task
|
// Task
|
||||||
|
$nboftasks = 0;
|
||||||
if (empty($id))
|
if (empty($id))
|
||||||
{
|
{
|
||||||
print '<td class="maxwidthonsmartphone">';
|
print '<td class="maxwidthonsmartphone">';
|
||||||
$formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
|
$nboftasks = $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contributor
|
// Contributor
|
||||||
print '<td class="maxwidthonsmartphone nowraponall">';
|
print '<td class="maxwidthonsmartphone nowraponall">';
|
||||||
print img_object('', 'user', 'class="hideonsmartphone"');
|
|
||||||
$contactsofproject = $projectstatic->getListContactId('internal');
|
$contactsofproject = $projectstatic->getListContactId('internal');
|
||||||
if (count($contactsofproject) > 0)
|
if (count($contactsofproject) > 0)
|
||||||
{
|
{
|
||||||
|
print img_object('', 'user', 'class="hideonsmartphone"');
|
||||||
if (in_array($user->id, $contactsofproject)) $userid = $user->id;
|
if (in_array($user->id, $contactsofproject)) $userid = $user->id;
|
||||||
else $userid = $contactsofproject[0];
|
else $userid = $contactsofproject[0];
|
||||||
|
|
||||||
@ -1170,7 +1174,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
|
if ($nboftasks) {
|
||||||
|
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -1202,8 +1208,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input type="submit" name="save" class="button buttongen marginleftonly marginbottomonly" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" name="save" class="button buttongen marginleftonly margintoponlyshort marginbottomonlyshort" value="'.$langs->trans("Add").'">';
|
||||||
print '<input type="submit" name="cancel" class="button buttongen marginleftonly" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" name="cancel" class="button buttongen marginleftonly margintoponlyshort marginbottomonlyshort" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -1504,9 +1510,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
if (($action == 'editline' || $action == 'splitline') && $_GET['lineid'] == $task_time->rowid)
|
if (($action == 'editline' || $action == 'splitline') && $_GET['lineid'] == $task_time->rowid)
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="lineid" value="'.$_GET['lineid'].'">';
|
print '<input type="hidden" name="lineid" value="'.$_GET['lineid'].'">';
|
||||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort" name="save" value="'.$langs->trans("Save").'">';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
|
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort" name="cancel" value="'.$langs->trans('Cancel').'">';
|
||||||
}
|
}
|
||||||
elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks
|
elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks
|
||||||
{
|
{
|
||||||
@ -1515,19 +1521,19 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
if ($conf->MAIN_FEATURES_LEVEL >= 2)
|
if ($conf->MAIN_FEATURES_LEVEL >= 2)
|
||||||
{
|
{
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=splitline&lineid='.$task_time->rowid.$param.'">';
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=splitline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||||
print img_split();
|
print img_split();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=editline&lineid='.$task_time->rowid.$param.'">';
|
print '<a class="reposition editfielda" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=editline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=deleteline&lineid='.$task_time->rowid.$param.'">';
|
print '<a class="reposition paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=deleteline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||||
print img_delete();
|
print img_delete('default', 'class="pictodelete paddingleft"');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
@ -1544,6 +1550,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
// Add line to split
|
// Add line to split
|
||||||
|
|
||||||
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
|
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
|
||||||
|
|||||||
@ -90,6 +90,7 @@ if (GETPOST('removedfile', 'alpha') && !GETPOST('add', 'alpha')) {
|
|||||||
dol_remove_file_process($_POST['removedfile'], 0, 0);
|
dol_remove_file_process($_POST['removedfile'], 0, 0);
|
||||||
$action = 'create_ticket';
|
$action = 'create_ticket';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
|
if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$origin_email = GETPOST('email', 'alpha');
|
$origin_email = GETPOST('email', 'alpha');
|
||||||
@ -241,11 +242,8 @@ if ($action == 'create_ticket' && GETPOST('add', 'alpha')) {
|
|||||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Send email to TICKET_NOTIFICATION_EMAIL_TO
|
// Send email to TICKET_NOTIFICATION_EMAIL_TO
|
||||||
|
|
||||||
$sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
$sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||||
|
|
||||||
if ($sendto)
|
if ($sendto)
|
||||||
{
|
{
|
||||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id);
|
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id);
|
||||||
@ -349,7 +347,7 @@ $arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php');
|
|||||||
llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
|
llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
|
||||||
print '<div style="width:60%; margin: 0 auto;" class="ticketpublicarea">';
|
print '<div class="ticketpublicarea">';
|
||||||
|
|
||||||
if ($action != "infos_success") {
|
if ($action != "infos_success") {
|
||||||
$formticket->withfromsocid = isset($socid) ? $socid : $user->socid;
|
$formticket->withfromsocid = isset($socid) ? $socid : $user->socid;
|
||||||
|
|||||||
@ -67,12 +67,12 @@ $arrayofcss = array('/ticket/css/styles.css.php');
|
|||||||
|
|
||||||
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
print '<div style="margin: 0 auto; width:60%" class="ticketpublicarea">';
|
print '<div class="ticketpublicarea">';
|
||||||
print '<p style="text-align: center">'.($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")).'</p>';
|
print '<p style="text-align: center">'.($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")).'</p>';
|
||||||
print '<div class="ticketform">';
|
print '<div class="ticketform">';
|
||||||
print '<a href="create_ticket.php" class=""><div class="index_create orange bigrounded">'.dol_escape_htmltag($langs->trans("CreateTicket")).'</div></a>';
|
print '<a href="create_ticket.php" class="butAction marginbottomonly"><div class="index_create bigrounded"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("CreateTicket")).'</div></a>';
|
||||||
print '<a href="list.php" class=""><div class="index_display blue bigrounded">'.dol_escape_htmltag($langs->trans("ShowListTicketWithTrackId")).'</div></a>';
|
print '<a href="list.php" class="butAction marginbottomonly"><div class="index_display bigrounded"><span class="fa fa-list-alt valignmiddle btnTitle-icon"></span><br>'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'</div></a>';
|
||||||
print '<a href="view.php" class=""><div class="index_display blue bigrounded">'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'</div></a>';
|
print '<a href="view.php" class="butAction marginbottomonly"><div class="index_display bigrounded">'.img_picto('', 'ticket').'<br>'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'</div></a>';
|
||||||
print '<div style="clear:both;"></div>';
|
print '<div style="clear:both;"></div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -170,7 +170,7 @@ $arrayofcss = array('/ticket/css/styles.css.php');
|
|||||||
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
|
||||||
print '<div style="margin: 0 auto; width:60%" class="ticketpublicarea">';
|
print '<div class="ticketpublicarealist">';
|
||||||
|
|
||||||
if ($action == "view_ticketlist")
|
if ($action == "view_ticketlist")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -224,7 +224,7 @@ $arrayofcss = array('/ticket/css/styles.css.php');
|
|||||||
|
|
||||||
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
print '<div style="margin: 0 auto;" class="ticketpublicarea">';
|
print '<div class="ticketpublicarea">';
|
||||||
|
|
||||||
if ($action == "view_ticket" || $action == "presend" || $action == "close" || $action == "confirm_public_close") {
|
if ($action == "view_ticket" || $action == "presend" || $action == "close" || $action == "confirm_public_close") {
|
||||||
if ($display_ticket)
|
if ($display_ticket)
|
||||||
|
|||||||
@ -212,6 +212,8 @@ class Reception extends CommonObject
|
|||||||
$this->brouillon = 1;
|
$this->brouillon = 1;
|
||||||
$this->tracking_number = dol_sanitizeFileName($this->tracking_number);
|
$this->tracking_number = dol_sanitizeFileName($this->tracking_number);
|
||||||
if (empty($this->fk_project)) $this->fk_project = 0;
|
if (empty($this->fk_project)) $this->fk_project = 0;
|
||||||
|
if (empty($this->weight_units)) $this->weight_units = 0;
|
||||||
|
if (empty($this->size_units)) $this->size_units = 0;
|
||||||
|
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
||||||
|
|||||||
@ -108,13 +108,14 @@ class Contacts extends DolibarrApi
|
|||||||
* @param int $limit Limit for list
|
* @param int $limit Limit for list
|
||||||
* @param int $page Page number
|
* @param int $page Page number
|
||||||
* @param string $thirdparty_ids Thirdparty ids to filter contacts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
* @param string $thirdparty_ids Thirdparty ids to filter contacts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i}
|
||||||
|
* @param int $category Use this param to filter list by category
|
||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||||
* @param int $includecount Count and return also number of elements the contact is used as a link for
|
* @param int $includecount Count and return also number of elements the contact is used as a link for
|
||||||
* @return array Array of contact objects
|
* @return array Array of contact objects
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $includecount = 0)
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $category = 0, $sqlfilters = '', $includecount = 0)
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
@ -135,6 +136,9 @@ class Contacts extends DolibarrApi
|
|||||||
|
|
||||||
$sql = "SELECT t.rowid";
|
$sql = "SELECT t.rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie_contact as c";
|
||||||
|
}
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as te ON te.fk_object = t.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as te ON te.fk_object = t.rowid";
|
||||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) {
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) {
|
||||||
// We need this table joined to the select in order to filter by sale
|
// We need this table joined to the select in order to filter by sale
|
||||||
@ -153,6 +157,13 @@ class Contacts extends DolibarrApi
|
|||||||
{
|
{
|
||||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Select contacts of given category
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= " AND c.fk_categorie = ".$db->escape($category);
|
||||||
|
$sql .= " AND c.fk_socpeople = t.rowid ";
|
||||||
|
}
|
||||||
|
|
||||||
// Add sql filters
|
// Add sql filters
|
||||||
if ($sqlfilters)
|
if ($sqlfilters)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -107,10 +107,11 @@ class Thirdparties extends DolibarrApi
|
|||||||
* Set to 2 to show only prospects
|
* Set to 2 to show only prospects
|
||||||
* Set to 3 to show only those are not customer neither prospect
|
* Set to 3 to show only those are not customer neither prospect
|
||||||
* Set to 4 to show only suppliers
|
* Set to 4 to show only suppliers
|
||||||
|
* @param int $category Use this param to filter list by category
|
||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.nom:like:'TheCompany%') and (t.date_creation:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.nom:like:'TheCompany%') and (t.date_creation:<:'20160101')"
|
||||||
* @return array Array of thirdparty objects
|
* @return array Array of thirdparty objects
|
||||||
*/
|
*/
|
||||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $sqlfilters = '')
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
@ -126,15 +127,27 @@ class Thirdparties extends DolibarrApi
|
|||||||
$sql = "SELECT t.rowid";
|
$sql = "SELECT t.rowid";
|
||||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as t";
|
||||||
|
if ($category > 0) {
|
||||||
|
if ($mode != 4) $sql .= ", ".MAIN_DB_PREFIX."categorie_societe as c";
|
||||||
|
if (!in_array($mode, array(1,2,3))) $sql .= ", ".MAIN_DB_PREFIX."categorie_fournisseur as cc";
|
||||||
|
}
|
||||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st";
|
$sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||||
$sql .= " WHERE t.fk_stcomm = st.id";
|
$sql .= " WHERE t.entity IN ('.getEntity('societe').')";
|
||||||
|
$sql .= " AND t.fk_stcomm = st.id";
|
||||||
|
|
||||||
if ($mode == 1) $sql .= " AND t.client IN (1, 3)";
|
if ($mode == 1) $sql .= " AND t.client IN (1, 3)";
|
||||||
if ($mode == 2) $sql .= " AND t.client IN (2, 3)";
|
if ($mode == 2) $sql .= " AND t.client IN (2, 3)";
|
||||||
if ($mode == 3) $sql .= " AND t.client IN (0)";
|
if ($mode == 3) $sql .= " AND t.client IN (0)";
|
||||||
if ($mode == 4) $sql .= " AND t.fournisseur IN (1)";
|
if ($mode == 4) $sql .= " AND t.fournisseur IN (1)";
|
||||||
$sql .= ' AND t.entity IN ('.getEntity('societe').')';
|
|
||||||
|
// Select thirdparties of given category
|
||||||
|
if ($category > 0) {
|
||||||
|
if (!empty($mode) && $mode != 4) { $sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid"; }
|
||||||
|
elseif (!empty($mode) && $mode == 4) { $sql .= " AND cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid"; }
|
||||||
|
else { $sql .= " AND ((c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid) OR (cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid))"; }
|
||||||
|
}
|
||||||
|
|
||||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= " AND t.rowid = sc.fk_soc";
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= " AND t.rowid = sc.fk_soc";
|
||||||
//if ($email != NULL) $sql.= " AND s.email = \"".$email."\"";
|
//if ($email != NULL) $sql.= " AND s.email = \"".$email."\"";
|
||||||
if ($socids) $sql .= " AND t.rowid IN (".$socids.")";
|
if ($socids) $sql .= " AND t.rowid IN (".$socids.")";
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||||
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
* Copyright (C) 2019-2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -965,7 +965,7 @@ class Societe extends CommonObject
|
|||||||
}
|
}
|
||||||
elseif ($rescode == -5)
|
elseif ($rescode == -5)
|
||||||
{
|
{
|
||||||
$this->errors[] = 'ErrorprefixRequired';
|
$this->errors[] = 'ErrorPrefixRequired';
|
||||||
}
|
}
|
||||||
$result = -3;
|
$result = -3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ span.butAction, span.butActionDelete {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em !important;
|
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||||
font-family: <?php print $fontlist ?>;
|
font-family: <?php print $fontlist ?>;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@ -296,6 +296,7 @@ input.buttonpaymentstripe {
|
|||||||
a.buttonticket {
|
a.buttonticket {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
|
/* height: 40px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Used by timesheets */
|
/* Used by timesheets */
|
||||||
@ -797,9 +798,15 @@ select.flat.selectlimit {
|
|||||||
.margintoponly {
|
.margintoponly {
|
||||||
margin-top: 10px !important;
|
margin-top: 10px !important;
|
||||||
}
|
}
|
||||||
|
.margintoponlyshort {
|
||||||
|
margin-top: 3px !important;
|
||||||
|
}
|
||||||
.marginbottomonly {
|
.marginbottomonly {
|
||||||
margin-bottom: 10px !important;
|
margin-bottom: 10px !important;
|
||||||
}
|
}
|
||||||
|
.marginbottomonlyshort {
|
||||||
|
margin-bottom: 3px !important;
|
||||||
|
}
|
||||||
.nomargintop {
|
.nomargintop {
|
||||||
margin-top: 0 !important;
|
margin-top: 0 !important;
|
||||||
}
|
}
|
||||||
@ -5817,7 +5824,8 @@ div.tabsElem a.tab {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ticketpublicarea {
|
.ticketpublicarea {
|
||||||
width: 70%;
|
margin-left: 15%;
|
||||||
|
margin-right: 15%;
|
||||||
}
|
}
|
||||||
.publicnewticketform {
|
.publicnewticketform {
|
||||||
/* margin-top: 25px !important; */
|
/* margin-top: 25px !important; */
|
||||||
@ -5833,7 +5841,8 @@ div.tabsElem a.tab {
|
|||||||
padding-left: 5px; padding-right: 5px;
|
padding-left: 5px; padding-right: 5px;
|
||||||
}
|
}
|
||||||
.ticketpublicarea {
|
.ticketpublicarea {
|
||||||
width: 100% !important;
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5808,7 +5808,8 @@ border-top-right-radius: 6px;
|
|||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
.ticketpublicarea {
|
.ticketpublicarea {
|
||||||
width: 70%;
|
margin-left: 15%;
|
||||||
|
margin-right: 15%;
|
||||||
}
|
}
|
||||||
.publicnewticketform {
|
.publicnewticketform {
|
||||||
/* margin-top: 25px !important; */
|
/* margin-top: 25px !important; */
|
||||||
@ -5824,7 +5825,8 @@ border-top-right-radius: 6px;
|
|||||||
padding-left: 5px; padding-right: 5px;
|
padding-left: 5px; padding-right: 5px;
|
||||||
}
|
}
|
||||||
.ticketpublicarea {
|
.ticketpublicarea {
|
||||||
width: 100%;
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -803,7 +803,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
|||||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
|
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref .= '</form>';
|
$morehtmlref .= '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -378,9 +378,9 @@ class ActionsTicket
|
|||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min margintoponly">';
|
||||||
print '<div class="tagtable centpercent">';
|
print '<div class="tagtable centpercent">';
|
||||||
print '<div class="tagtr liste_titre">';
|
print '<div class="tagtr">';
|
||||||
// Exclude status which requires specific method
|
// Exclude status which requires specific method
|
||||||
$exclude_status = array(Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED);
|
$exclude_status = array(Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED);
|
||||||
// Exclude actual status
|
// Exclude actual status
|
||||||
@ -402,7 +402,7 @@ class ActionsTicket
|
|||||||
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&new_status='.$status;
|
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&new_status='.$status;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<a class="button buttonticket" href="'.$urlforbutton.'">';
|
print '<a class="butAction buttonticket" href="'.$urlforbutton.'">';
|
||||||
print img_picto($langs->trans($object->statuts_short[$status]), 'statut'.$status.'.png@ticket').' '.$langs->trans($object->statuts_short[$status]);
|
print img_picto($langs->trans($object->statuts_short[$status]), 'statut'.$status.'.png@ticket').' '.$langs->trans($object->statuts_short[$status]);
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -2592,7 +2592,6 @@ class Ticket extends CommonObject
|
|||||||
$message .= "\n".$langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.'<a href="'.$url_internal_ticket.'">'.$object->track_id.'</a>'."\n";
|
$message .= "\n".$langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.'<a href="'.$url_internal_ticket.'">'.$object->track_id.'</a>'."\n";
|
||||||
|
|
||||||
// Add global email address recipient
|
// Add global email address recipient
|
||||||
// altairis: use new TICKET_NOTIFICATION_EMAIL_TO configuration variable
|
|
||||||
if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) {
|
if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) {
|
||||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,56 +74,13 @@ div.ticketform {
|
|||||||
div.ticketform .index_create, .index_display {
|
div.ticketform .index_create, .index_display {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 58px;
|
height: 45px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.ticketform .orange {
|
|
||||||
color: #fef4e9;
|
|
||||||
border: solid 1px #da7c0c;
|
|
||||||
background: #f78d1d;
|
|
||||||
background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
|
|
||||||
background: -moz-linear-gradient(top, #faa51a, #f47a20);
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
|
|
||||||
}
|
|
||||||
div.ticketform .orange:active {
|
|
||||||
color: #fcd3a5;
|
|
||||||
background: -webkit-gradient(linear, left top, left bottom, from(#f47a20), to(#faa51a));
|
|
||||||
background: -moz-linear-gradient(top, #f47a20, #faa51a);
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f47a20', endColorstr='#faa51a');
|
|
||||||
}
|
|
||||||
|
|
||||||
div.ticketform .orange:hover {
|
|
||||||
background: #f47c20;
|
|
||||||
background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
|
|
||||||
background: -moz-linear-gradient(top, #f88e11, #f06015);
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
|
|
||||||
}
|
|
||||||
|
|
||||||
div.ticketform .blue {
|
|
||||||
color: #d9eef7;
|
|
||||||
border: solid 1px #0076a3;
|
|
||||||
background: #0095cd;
|
|
||||||
background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
|
|
||||||
background: -moz-linear-gradient(top, #00adee, #0078a5);
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
|
|
||||||
}
|
|
||||||
div.ticketform .blue:active {
|
|
||||||
color: #80bed6;
|
|
||||||
background: -webkit-gradient(linear, left top, left bottom, from(#0078a5), to(#00adee));
|
|
||||||
background: -moz-linear-gradient(top, #0078a5, #00adee);
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0078a5', endColorstr='#00adee');
|
|
||||||
}
|
|
||||||
div.ticketform .blue:hover {
|
|
||||||
background: #007ead;
|
|
||||||
background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
|
|
||||||
background: -moz-linear-gradient(top, #0095cc, #00678e);
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e');
|
|
||||||
}
|
|
||||||
|
|
||||||
#form_create_ticket, #form_view_ticket
|
#form_create_ticket, #form_view_ticket
|
||||||
{
|
{
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
|||||||
@ -145,6 +145,22 @@ if ($action == 'update' && !$cancel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update personal email
|
||||||
|
if ($action == 'setpersonal_email')
|
||||||
|
{
|
||||||
|
$object->personal_email = GETPOST('personal_email');
|
||||||
|
$result = $object->update($user);
|
||||||
|
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
// update personal mobile
|
||||||
|
if ($action == 'setpersonal_mobile')
|
||||||
|
{
|
||||||
|
$object->personal_mobile = GETPOST('personal_mobile');
|
||||||
|
$result = $object->update($user);
|
||||||
|
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -197,6 +213,22 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
|||||||
print '<td>'.$object->login.'</td>';
|
print '<td>'.$object->login.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="nowrap">';
|
||||||
|
print '<td>';
|
||||||
|
print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer);
|
||||||
|
print '</td><td>';
|
||||||
|
print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer, 'email', ($object->personal_email != '' ? dol_print_email($object->personal_email) : ''));
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="nowrap">';
|
||||||
|
print '<td>';
|
||||||
|
print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer);
|
||||||
|
print '</td><td>';
|
||||||
|
print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer, 'string', ($object->personal_mobile != '' ? dol_print_phone($object->personal_mobile) : ''));
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
/* Copyright (C) 2030 Thibault FOUCART <support@ptibogxiv.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -62,10 +63,11 @@ class Users extends DolibarrApi
|
|||||||
* @param int $limit Limit for list
|
* @param int $limit Limit for list
|
||||||
* @param int $page Page number
|
* @param int $page Page number
|
||||||
* @param string $user_ids User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
* @param string $user_ids User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||||
|
* @param int $category Use this param to filter list by category
|
||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||||
* @return array Array of User objects
|
* @return array Array of User objects
|
||||||
*/
|
*/
|
||||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $category = 0, $sqlfilters = '')
|
||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
@ -80,8 +82,18 @@ class Users extends DolibarrApi
|
|||||||
|
|
||||||
$sql = "SELECT t.rowid";
|
$sql = "SELECT t.rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user as t";
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie_user as c";
|
||||||
|
}
|
||||||
$sql .= ' WHERE t.entity IN ('.getEntity('user').')';
|
$sql .= ' WHERE t.entity IN ('.getEntity('user').')';
|
||||||
if ($user_ids) $sql .= " AND t.rowid IN (".$user_ids.")";
|
if ($user_ids) $sql .= " AND t.rowid IN (".$user_ids.")";
|
||||||
|
|
||||||
|
// Select products of given category
|
||||||
|
if ($category > 0) {
|
||||||
|
$sql .= " AND c.fk_categorie = ".$db->escape($category);
|
||||||
|
$sql .= " AND c.fk_user = t.rowid ";
|
||||||
|
}
|
||||||
|
|
||||||
// Add sql filters
|
// Add sql filters
|
||||||
if ($sqlfilters)
|
if ($sqlfilters)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -936,7 +936,7 @@ if ($action == 'addcontainer')
|
|||||||
} else {
|
} else {
|
||||||
$filetpl = $pathofwebsite.'/page'.$pageid.'.tpl.php';
|
$filetpl = $pathofwebsite.'/page'.$pageid.'.tpl.php';
|
||||||
|
|
||||||
// Generate the index.php page to be the home page
|
// Generate the index.php page (to be the home page) and wrapper.php file
|
||||||
$result = dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper);
|
$result = dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper);
|
||||||
|
|
||||||
if ($result <= 0) setEventMessages('Failed to write file '.$fileindex, null, 'errors');
|
if ($result <= 0) setEventMessages('Failed to write file '.$fileindex, null, 'errors');
|
||||||
|
|||||||
@ -101,7 +101,11 @@ if ($rss) {
|
|||||||
|
|
||||||
$MAXNEWS = 20;
|
$MAXNEWS = 20;
|
||||||
$arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, $filters);
|
$arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, $filters);
|
||||||
$eventarray = $arrayofblogs;
|
$eventarray = array();
|
||||||
|
foreach ($arrayofblogs as $blog) {
|
||||||
|
$blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php';
|
||||||
|
$eventarray[] = $blog;
|
||||||
|
}
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php";
|
require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php";
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
|
require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
|
||||||
@ -137,14 +141,15 @@ if ($rss) {
|
|||||||
|
|
||||||
if ($buildfile)
|
if ($buildfile)
|
||||||
{
|
{
|
||||||
$title = $desc = $langs->transnoentities('LastBlogPosts');
|
$langs->load("other");
|
||||||
|
$title = $desc = $langs->transnoentities('LatestBlogPosts');
|
||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads
|
||||||
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
@chmod($outputfiletmp, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp);
|
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1');
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user