Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
d8b63e6fa6
39 changed files with 407 additions and 83 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -52,6 +52,7 @@ dev/build/node_modules/
|
|||
node_modules/
|
||||
|
||||
vendor/
|
||||
php-vendor
|
||||
tmp/
|
||||
|
||||
#yarn
|
||||
|
|
|
|||
|
|
@ -198,6 +198,11 @@ if (empty($reshook)) {
|
|||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
$subledger_account_str = is_array($subledger_account) ? reset($subledger_account) : (string) $subledger_account;
|
||||
if (!checkGeneralAccountAllowsAuxiliary($db, $accountingaccount_number, $subledger_account_str)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorAccountNotCentralized"). ". " . $langs->trans("RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"), null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) {
|
||||
|
|
@ -520,6 +525,29 @@ if ($action == 'delete') {
|
|||
print $formconfirm;
|
||||
}
|
||||
|
||||
// Update fields properties in realtime
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n" . '<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
function toggleSubledger() {
|
||||
var isCentral = $("#accountingaccount_number option:selected").data("centralized");
|
||||
console.log("the selected general ledger account is centralised?", isCentral);
|
||||
if (isCentral) {
|
||||
$("#subledger_account, #subledger_label").prop("disabled", false);
|
||||
} else {
|
||||
$("#subledger_account, #subledger_label").prop("disabled", true);
|
||||
}
|
||||
}
|
||||
|
||||
toggleSubledger();
|
||||
|
||||
$("#accountingaccount_number").on("change", toggleSubledger);
|
||||
$("#accountingaccount_number").on("select2:select", toggleSubledger);
|
||||
';
|
||||
print ' });' . "\n";
|
||||
print ' </script>' . "\n";
|
||||
}
|
||||
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($title);
|
||||
|
||||
|
|
@ -995,7 +1023,7 @@ if ($action == 'create') {
|
|||
print '<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
|
||||
}
|
||||
// Add also input for subledger label
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="'.(GETPOSTISSET("subledger_label") ? GETPOST("subledger_label", "alpha") : $line->subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" id="subledger_label" value="'.(GETPOSTISSET("subledger_label") ? GETPOST("subledger_label", "alpha") : $line->subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.(GETPOSTISSET("label_operation") ? GETPOST("label_operation", "alpha") : $line->label_operation).'"></td>';
|
||||
print '<td class="right"><input type="text" class="right width50" name="debit" value="'.(GETPOSTISSET("debit") ? GETPOST("debit", "alpha") : price($line->debit)).'"></td>';
|
||||
|
|
@ -1022,7 +1050,7 @@ if ($action == 'create') {
|
|||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
|
||||
}
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" id="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . dol_escape_htmltag($label_operation) . '"/></td>';
|
||||
print '<td class="right"><input type="text" class="right width50" name="debit" value=""/></td>';
|
||||
|
|
|
|||
|
|
@ -68,11 +68,11 @@ class AdherentStats extends Stats
|
|||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $socid Id third party
|
||||
* @param int $userid Id user for filter
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $socid Id third party
|
||||
* @param int $userid Id user for filter
|
||||
*/
|
||||
public function __construct($db, $socid = 0, $userid = 0)
|
||||
{
|
||||
|
|
@ -97,11 +97,11 @@ class AdherentStats extends Stats
|
|||
|
||||
|
||||
/**
|
||||
* Return the number of proposition by month for a given year
|
||||
* Return the number of members by month for a given year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array<int<0,11>,array{0:int<1,12>,1:int}> Array of nb each month
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array<int<0,11>,array{0:int<1,12>,1:int}> Array of nb each month
|
||||
*/
|
||||
public function getNbByMonth($year, $format = 0)
|
||||
{
|
||||
|
|
@ -136,7 +136,7 @@ class AdherentStats extends Stats
|
|||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values by month
|
||||
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values by month
|
||||
*/
|
||||
public function getAmountByMonth($year, $format = 0)
|
||||
{
|
||||
|
|
@ -375,7 +375,7 @@ class AdherentStats extends Stats
|
|||
'datem' => $this->db->jdate($objp->datem),
|
||||
'status' => (int) $objp->status,
|
||||
'date_end_subscription' => $this->db->jdate($objp->date_end_subscription),
|
||||
'photo' => $objp->photo,
|
||||
'photo' => isset($objp->photo) ? (string) $objp->photo : null,
|
||||
'email' => $objp->email,
|
||||
'gender' => $objp->gender,
|
||||
'morphy' => $objp->morphy,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherentstats.class.php';
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -44,6 +45,11 @@ class Members extends DolibarrApi
|
|||
'typeid'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var AdherentStats
|
||||
*/
|
||||
public $memberstats;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
|
@ -51,6 +57,7 @@ class Members extends DolibarrApi
|
|||
{
|
||||
global $db;
|
||||
$this->db = $db;
|
||||
$this->memberstats = new AdherentStats($this->db, DolibarrApiAccess::$user->socid, DolibarrApiAccess::$user->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -982,6 +989,91 @@ class Members extends DolibarrApi
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array with the number of members by month for a given year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text
|
||||
* 1=Label of abscissa is month number
|
||||
* 2=Label of abscissa is first letter of month
|
||||
* @return array Array of statistics for last modified members
|
||||
* @phan-return array<int<0,11>,array{0:int<1,12>,1:int}> Array of nb each month
|
||||
* @phpstan-return array<int<0,11>,array{0:int<1,12>,1:int}> Array of nb each month
|
||||
*
|
||||
* @url GET stats/nbbymonth
|
||||
* @throws RestException 403 Access denied
|
||||
*/
|
||||
public function getNbByMonth($year, $format = 0)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
return $this->memberstats->getNbByMonth($year, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array with the number of subscriptions by year
|
||||
*
|
||||
* @return array Array of statistics for last modified members
|
||||
* @phan-return array<array{0:int,1:int}> Array of nb each year
|
||||
* @phpstan-return array<array{0:int,1:int}> Array of nb each year
|
||||
*
|
||||
* @url GET stats/nbbyyear
|
||||
* @throws RestException 403 Access denied
|
||||
*/
|
||||
public function getNbByYear()
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
return $this->memberstats->getNbByYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of subscriptions by month for a given year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array Array of statistics for last modified members
|
||||
* @phan-return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values by month
|
||||
* @phpstan-return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values by month
|
||||
*
|
||||
* @url GET stats/amountbymonth
|
||||
* @throws RestException 403 Access denied
|
||||
*/
|
||||
public function getAmountByMonth($year, $format = 0)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
return $this->memberstats->getAmountByMonth($year, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Last Modified Members
|
||||
*
|
||||
* Get an array of statistics for last modified members
|
||||
*
|
||||
* @param int $max Max numbers of members
|
||||
* @return array Array of statistics for last modified members
|
||||
* @phan-return array<int,array{id:int,ref:string,firstname:string,lastname:string,company:string,fk_soc:?int,datec:int|'',datem:int|'',status:int,date_end_subscription:int|'',photo:null|string,email:string,gender:string,morphy:string,typeid:int,need_subscription:0|1|null,subscription:'0'|'1'|null,label:string}>
|
||||
* @phpstan-return array<int,array{id:int,ref:string,firstname:string,lastname:string,company:string,fk_soc:?int,datec:int|'',datem:int|'',status:int,date_end_subscription:int|'',photo:null|string,email:string,gender:string,morphy:string,typeid:int,need_subscription:0|1|null,subscription:'0'|'1'|null,label:string}>
|
||||
*
|
||||
* @url GET stats/lastmodifiedmembers
|
||||
* @throws RestException 403 Access denied
|
||||
*/
|
||||
public function getLastModifiedMembers($max)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
return $this->memberstats->getLastModifiedMembers($max);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate fields before creating an object
|
||||
*
|
||||
|
|
|
|||
|
|
@ -127,13 +127,14 @@ if ($conf->use_javascript_ajax) {
|
|||
}
|
||||
}
|
||||
|
||||
$dataseries = array();
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), $sumMembers['total']['members_draft']); // Draft, not yet validated
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("WaitingSubscription"), $sumMembers['total']['members_pending']);
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), $sumMembers['total']['members_uptodate']);
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), $sumMembers['total']['members_expired']);
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), $sumMembers['total']['members_excluded']);
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), $sumMembers['total']['members_resiliated']);
|
||||
$dataseries = [
|
||||
[$langs->transnoentitiesnoconv("MembersStatusToValid"), $sumMembers['total']['members_draft']], // Draft, not yet validated
|
||||
[$langs->transnoentitiesnoconv("WaitingSubscription"), $sumMembers['total']['members_pending']],
|
||||
[$langs->transnoentitiesnoconv("UpToDate"), $sumMembers['total']['members_uptodate']],
|
||||
[$langs->transnoentitiesnoconv("OutOfDate"), $sumMembers['total']['members_expired']],
|
||||
[$langs->transnoentitiesnoconv("MembersStatusExcluded"), $sumMembers['total']['members_excluded']],
|
||||
[$langs->transnoentitiesnoconv("MembersStatusResiliated"), $sumMembers['total']['members_resiliated']],
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string $badgeStatus0
|
||||
|
|
|
|||
|
|
@ -799,7 +799,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||
$moreforfilter .= '<input type="submit" name="buttonsubmit" class="button small nomarginleft" value="'.dolPrintHTMLForAttribute($langs->trans("Refresh")).'">';
|
||||
if ($search_keyword || ($search_nature && $search_nature != '-1') || ($search_version && $search_version != '-1') || ($search_status && $search_status != '-1')) {
|
||||
$moreforfilter .= ' ';
|
||||
$moreforfilter .= '<input type="submit" name="buttonreset" class="buttonreset noborderbottom" value="'.dolPrintHTMLForAttribute($langs->trans("Reset")).'">';
|
||||
$moreforfilter .= '<input type="submit" name="buttonreset" class="buttonreset noborderbottom nomargintop nomarginbottom" value="'.dolPrintHTMLForAttribute($langs->trans("Reset")).'">';
|
||||
}
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= '</div>';
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ if (empty($error) && !empty($xml)) {
|
|||
$out .= '<td></td>'."\n";
|
||||
$out .= '<td>'.$langs->trans("ModuleMustBeEnabled", $langs->transnoentitiesnoconv("BlockedLog")).'</td>'."\n";
|
||||
$out .= '<td class="center">'.yn(1).'</td>'."\n";
|
||||
$out .= '<td class="center">'.yn(isModEnabled('blockedlog')).'</td>'."\n";
|
||||
$out .= '<td class="center">'.yn(isModEnabled('blockedlog') ? 1 : 0).'</td>'."\n";
|
||||
$out .= "</tr>\n";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ class BlockedLog
|
|||
public $linktype = '';
|
||||
|
||||
/**
|
||||
* @var string $linkref
|
||||
* @var string $linktoref
|
||||
*/
|
||||
public $linkref = '';
|
||||
public $linktoref = '';
|
||||
|
||||
/**
|
||||
* Object element
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ $sql .= " typent.code as typent_code,";
|
|||
$sql .= " ava.rowid as availability,";
|
||||
$sql .= " country.code as country_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql .= ' p.rowid, p.entity as propal_entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.import_key, p.fk_user_author, p.datep as dp, p.fin_validite as dfv, p.date_livraison as ddelivery,';
|
||||
$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.import_key, p.fk_user_author, p.datep as dp, p.fin_validite as dfv, p.date_livraison as ddelivery,';
|
||||
$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
|
||||
$sql .= ' p.datec as date_creation, p.tms as date_modification, p.date_cloture as date_cloture,';
|
||||
$sql .= ' p.date_signature as dsignature,';
|
||||
|
|
@ -1944,7 +1944,7 @@ while ($i < $imaxinloop) {
|
|||
// Other picto tool
|
||||
print '<td width="16" class="nobordernopadding right">';
|
||||
$filename = dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->propal->multidir_output[$obj->propal_entity].'/'.dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
print $formfile->getDocumentsLink($object->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
|
|
|||
|
|
@ -1857,7 +1857,7 @@ if (!empty($arrayfields['country.code_iso']['checked'])) {
|
|||
}
|
||||
// Company type
|
||||
if (!empty($arrayfields['typent.code']['checked'])) {
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1);
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -2598,7 +2598,7 @@ while ($i < $imaxinloop) {
|
|||
|
||||
// Country
|
||||
if (!empty($arrayfields['country.code_iso']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center tdoverflowmax100">';
|
||||
$tmparray = getCountry($obj->fk_pays, 'all');
|
||||
print $tmparray['label'];
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -431,6 +431,19 @@ if ($action == 'create') {
|
|||
$(\'#fieldchqemetteur\').val(\'\');
|
||||
}
|
||||
}
|
||||
function toggleSubledger() {
|
||||
var isCentral = $("#accountancy_code option:selected").data("centralized");
|
||||
console.log("the selected general ledger account is centralised?", isCentral);
|
||||
if (isCentral) {
|
||||
$("#subledger_account").prop("disabled", false);
|
||||
} else {
|
||||
$("#subledger_account").prop("disabled", true);
|
||||
}
|
||||
}
|
||||
toggleSubledger();
|
||||
|
||||
$("#accountancy_code").on("change", toggleSubledger);
|
||||
$("#accountancy_code").on("select2:select", toggleSubledger);
|
||||
';
|
||||
|
||||
print ' });'."\n";
|
||||
|
|
|
|||
|
|
@ -84,10 +84,10 @@ class box_last_modified_ticket extends ModeleBoxes
|
|||
$sql .= ", type.label as type_label, category.label as category_label, severity.label as severity_label";
|
||||
$sql .= ", s.nom as company_name, s.email as socemail, s.client, s.fournisseur";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_extrafields as tef ON tef.fk_object=t.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code=t.severity_code";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_extrafields as tef ON tef.fk_object = t.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code = t.type_code AND type.entity = t.entity";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code = t.category_code AND category.entity = t.entity";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code = t.severity_code AND severity.entity = t.entity";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=t.fk_soc";
|
||||
|
||||
$sql .= " WHERE t.entity IN (".getEntity('ticket').')';
|
||||
|
|
|
|||
|
|
@ -2211,7 +2211,7 @@ class Form
|
|||
global $action;
|
||||
|
||||
// If no preselected user defined, we take current user
|
||||
if ((is_numeric($selected) && ($selected < -3 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) {
|
||||
if ((is_numeric($selected) && ($selected < -4 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) {
|
||||
$selected = $user->id;
|
||||
}
|
||||
|
||||
|
|
@ -2388,6 +2388,18 @@ class Form
|
|||
'picto' => ''
|
||||
);
|
||||
}
|
||||
if ($showalso == 4) {
|
||||
$out .= '<option value="-4"' . ((in_array(-4, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("AllProjectContacts") . ' --</option>' . "\n";
|
||||
|
||||
$outarray[-4] = '-- ' . $langs->trans("AllProjectContacts") . ' --';
|
||||
$outarray2[-4] = array(
|
||||
'id' => -4,
|
||||
'label' => '-- ' . $langs->trans("AllProjectContacts") . ' --',
|
||||
'labelhtml' => '-- ' . $langs->trans("AllProjectContacts") . ' --',
|
||||
'color' => '',
|
||||
'picto' => ''
|
||||
);
|
||||
}
|
||||
|
||||
$userstatic = new User($this->db);
|
||||
|
||||
|
|
@ -4230,7 +4242,7 @@ class Form
|
|||
$outvallabel .= ' ' . $langs->transnoentities("Units");
|
||||
}
|
||||
|
||||
if ($objp->quantity > 1) {
|
||||
if ($objp->quantity != 1) {
|
||||
$optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
$outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
/* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
|
|
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
|||
class FormAccounting extends Form
|
||||
{
|
||||
/**
|
||||
* @var array<string,array<string,string>>
|
||||
* @var array<string, array<string, string>|array<string, array<string, mixed>>>
|
||||
*/
|
||||
private $options_cache = array();
|
||||
|
||||
|
|
@ -457,7 +457,10 @@ class FormAccounting extends Form
|
|||
$selected = $select_value_out;
|
||||
}
|
||||
|
||||
$options[$select_value_out] = $label;
|
||||
$options[$select_value_out] = array(
|
||||
'label' => $label,
|
||||
'data-centralized' => $obj->centralized ? 1 : 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1039,6 +1039,12 @@ class Notify
|
|||
'notification'
|
||||
);
|
||||
|
||||
if (! empty($mailfile->error) || ! empty($mailfile->errors)) {
|
||||
$this->error = $mailfile->error;
|
||||
$this->errors = $mailfile->errors;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($mailfile->sendfile()) {
|
||||
if ($obj->type_target == 'touserid') {
|
||||
$sql = "INSERT INTO ".$this->db->prefix()."notify (daten, fk_action, fk_soc, fk_user, type, objet_type, type_target, objet_id, email)";
|
||||
|
|
@ -1360,6 +1366,12 @@ class Notify
|
|||
'notification'
|
||||
);
|
||||
|
||||
if (! empty($mailfile->error) || ! empty($mailfile->errors)) {
|
||||
$this->error = $mailfile->error;
|
||||
$this->errors = $mailfile->errors;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($mailfile->sendfile()) {
|
||||
$sql = "INSERT INTO ".$this->db->prefix()."notify (daten, fk_action, fk_soc, fk_contact, type, type_target, objet_type, objet_id, email)";
|
||||
$sql .= " VALUES ('".$this->db->idate(dol_now())."', ".((int) $notifcodedefid).", ".($object->socid > 0 ? ((int) $object->socid) : 'null').", null, 'email', 'tofixedemail', '".$this->db->escape($object_type)."', ".((int) $object->id).", '".$this->db->escape($sendto)."')";
|
||||
|
|
|
|||
|
|
@ -8478,7 +8478,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id
|
|||
/**
|
||||
* Return yes or no in current language
|
||||
*
|
||||
* @param int<0, 1>|'yes'|'true'|'no'|'false' $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false')
|
||||
* @param boolean|int<0, 1>|'yes'|'true'|'no'|'false' $yesno Value to test (true, 1, 'yes', 'true' or false, 0, 'no', 'false')
|
||||
* @param integer|string $format 1=Yes/No, 0=yes/no, 2=Disabled/enabled checkbox, 3=Disabled/enabled checkbox + Yes/No, 4 or Text=Use picto
|
||||
* @param int $color 0=texte only, 1=Text is formatted with a color font style ('ok' or 'error'), 2=Text is formatted with 'ok' color.
|
||||
* @return string HTML string
|
||||
|
|
@ -8489,7 +8489,7 @@ function yn($yesno, $format = 1, $color = 0)
|
|||
|
||||
$result = 'unknown';
|
||||
$classname = '';
|
||||
if ($yesno == 1 || (isset($yesno) && (strtolower($yesno) == 'yes' || strtolower($yesno) == 'true'))) { // To set to 'no' before the test because of the '== 0'
|
||||
if ($yesno === true || (int) $yesno == 1 || (isset($yesno) && (strtolower($yesno) == 'yes' || strtolower($yesno) == 'true'))) { // To set to 'no' before the test because of the '== 0'
|
||||
$result = $langs->trans('yes');
|
||||
if ($format == 1 || $format == 3) {
|
||||
$result = $langs->trans("Yes");
|
||||
|
|
@ -8505,7 +8505,7 @@ function yn($yesno, $format = 1, $color = 0)
|
|||
}
|
||||
|
||||
$classname = 'ok';
|
||||
} elseif ($yesno == 0 || strtolower($yesno) == 'no' || strtolower($yesno) == 'false') {
|
||||
} else {
|
||||
$result = $langs->trans("no");
|
||||
if ($format == 1 || $format == 3) {
|
||||
$result = $langs->trans("No");
|
||||
|
|
@ -14644,6 +14644,20 @@ function getElementProperties($elementType)
|
|||
$classname = 'Fournisseur';
|
||||
$table_element = 'societe';
|
||||
$subelement = '';
|
||||
} elseif ($elementType == 'recruitmentcandidature') {
|
||||
$module = 'recruitment';
|
||||
$classfile = 'recruitmentcandidature';
|
||||
$classpath = 'recruitment/class';
|
||||
$classname = 'RecruitmentCandidature';
|
||||
$subelement = 'recruitmentcandidature';
|
||||
$subdir = '/recruitmentcandidature';
|
||||
} elseif ($elementType == 'recruitmentjobposition') {
|
||||
$module = 'recruitment';
|
||||
$classfile = 'recruitmentjobposition';
|
||||
$classpath = 'recruitment/class';
|
||||
$classname = 'RecruitmentJobPosition';
|
||||
$subelement = 'recruitmentjobposition';
|
||||
$subdir = '/recruitmentjobposition';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2653,7 +2653,7 @@ function getModuleDirForApiClass($moduleobject)
|
|||
$moduledirforclass = 'contrat';
|
||||
} elseif (in_array($moduleobject, array('admin', 'login', 'setup', 'access', 'status', 'tools', 'documents', 'objectlinks'))) {
|
||||
$moduledirforclass = 'api';
|
||||
} elseif ($moduleobject == 'contact' || $moduleobject == 'contacts' || $moduleobject == 'customer' || $moduleobject == 'thirdparty' || $moduleobject == 'thirdparties') {
|
||||
} elseif (in_array($moduleobject, ['contact', 'contacts', 'customer', 'thirdparty', 'thirdparties'])) {
|
||||
$moduledirforclass = 'societe';
|
||||
} elseif ($moduleobject == 'propale' || $moduleobject == 'proposals') {
|
||||
$moduledirforclass = 'comm/propal';
|
||||
|
|
@ -2661,7 +2661,7 @@ function getModuleDirForApiClass($moduleobject)
|
|||
$moduledirforclass = 'comm/action';
|
||||
} elseif ($moduleobject == 'mailing') {
|
||||
$moduledirforclass = 'comm/mailing';
|
||||
} elseif ($moduleobject == 'adherent' || $moduleobject == 'members' || $moduleobject == 'memberstypes' || $moduleobject == 'subscriptions') {
|
||||
} elseif (in_array($moduleobject, ['adherent', 'members', 'memberstypes', 'subscriptions'])) {
|
||||
$moduledirforclass = 'adherents';
|
||||
} elseif ($moduleobject == 'don' || $moduleobject == 'donations') {
|
||||
$moduledirforclass = 'don';
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class InterfaceNotification extends DolibarrTriggers
|
|||
$notify = new Notify($this->db);
|
||||
$resultSend = $notify->send($action, $object);
|
||||
if ($resultSend < 0) {
|
||||
$this->errors = array_merge(empty($this->errors) ? array() : $this->errors, $notify->errors);
|
||||
$this->errors = array_merge(empty($this->errors) ? array() : $this->errors, empty($notify->error) ? array() : array($notify->error), $notify->errors);
|
||||
return $resultSend;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1024,6 +1024,7 @@ class Cronjob extends CommonObject
|
|||
$object->datelastrun = null;
|
||||
$object->lastresult = '';
|
||||
$object->datelastresult = null;
|
||||
$object->datenextrun = dol_now();
|
||||
$object->lastoutput = '';
|
||||
$object->nbrun = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -256,6 +256,7 @@ VATIntraSyntaxIsValid=Syntax is valid
|
|||
VATPaymentFrequency=VAT payment frequency
|
||||
ProspectCustomer=Prospect / Customer
|
||||
Prospect=Prospect
|
||||
ProspectsOrCustomers=Prospects or customers
|
||||
CustomerCard=Customer Card
|
||||
Customer=Customer
|
||||
CustomerRelativeDiscount=Relative customer discount
|
||||
|
|
|
|||
|
|
@ -1395,3 +1395,4 @@ NeedHelpCenter=Need support?
|
|||
Efficiency=Efficiency
|
||||
AccordingToYourSetupTheFileWillBeConcatenated=According to your setup, the file %s (uploaded in module setup) will be concatenated to any generated PDF
|
||||
TransactionID=Transaction ID
|
||||
AllProjectContacts=All project contacts
|
||||
|
|
@ -156,7 +156,7 @@ class modMyModule extends DolibarrModules
|
|||
$this->langfiles = array("mymodule@mymodule");
|
||||
|
||||
// Prerequisites
|
||||
$this->phpmin = array(7, 1); // Minimum version of PHP required by module
|
||||
$this->phpmin = array(7, 2); // Minimum version of PHP required by module
|
||||
// $this->phpmax = array(8, 0); // Maximum version of PHP required by module
|
||||
$this->need_dolibarr_version = array(19, -3); // Minimum version of Dolibarr required by module
|
||||
// $this->max_dolibarr_version = array(19, -3); // Maximum version of Dolibarr required by module
|
||||
|
|
|
|||
|
|
@ -2435,7 +2435,8 @@ class Product extends CommonObject
|
|||
$price_min = $this->multiprices_min[$thirdparty_buyer->price_level];
|
||||
$price_min_ttc = $this->multiprices_min_ttc[$thirdparty_buyer->price_level];
|
||||
$price_base_type = $this->multiprices_base_type[$thirdparty_buyer->price_level];
|
||||
if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility
|
||||
if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {
|
||||
// using this option is a bug. kept for backward compatibility
|
||||
if (isset($this->multiprices_tva_tx[$thirdparty_buyer->price_level])) {
|
||||
$tva_tx = $this->multiprices_tva_tx[$thirdparty_buyer->price_level];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ if ($object->id > 0 && $upload_dir !== null) {
|
|||
$titre = $langs->trans("CardProduct".$object->type);
|
||||
$picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
|
||||
|
||||
print dol_get_fiche_head($head, 'documents', $titre, -1, $picto);
|
||||
print dol_get_fiche_head($head, 'documents', $titre, -1, $picto, 0, '', '', 0, '', 1);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
|
|||
|
|
@ -972,11 +972,11 @@ if ($id > 0 || $ref) {
|
|||
'pfp.supplier_reputation' => array('label' => $langs->trans("ReputationForThisProduct"), 'checked' => '-1', 'position' => 14),
|
||||
'pfp.fk_barcode_type' => array('label' => $langs->trans("BarcodeType"), 'enabled' => (string) (int) isModEnabled('barcode'), 'checked' => '0', 'position' => 15),
|
||||
'pfp.barcode' => array('label' => $langs->trans("BarcodeValue"), 'enabled' => (string) (int) isModEnabled('barcode'), 'checked' => '0', 'position' => 16),
|
||||
'pfp.packaging' => array('label' => $langs->trans("PackagingForThisProduct"), 'enabled' => (string) getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked' => '0', 'position' => 17),
|
||||
'pfp.status' => array('label' => $langs->trans("Status"), 'enabled' => '1', 'checked' => '0', 'position' => 40),
|
||||
'pfp.tms' => array('label' => $langs->trans("DateModification"), 'enabled' => '1', 'checked' => '1', 'position' => 50),
|
||||
'pfp.packaging' => array('label' => $langs->trans("PackagingForThisProduct"), 'enabled' => (string) getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked' => (getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING') ? '1' : '0'), 'position' => 17),
|
||||
'pfp.price' => array('label' => $langs->trans("PriceQtyMinHT"), 'enabled' => '1', 'checked' => '1', 'position' => 60),
|
||||
'pfp.multicurrency_price' => array('label' => $langs->trans("PriceQtyMinHTCurrency"), 'enabled' => (string) (int) isModEnabled('multicurrency'), 'checked' => '1', 'position' => 70),
|
||||
'pfp.tms' => array('label' => $langs->trans("DateModification"), 'enabled' => '1', 'checked' => '-1', 'position' => 80),
|
||||
'pfp.status' => array('label' => $langs->trans("Status"), 'enabled' => '1', 'checked' => '0', 'position' => 200),
|
||||
);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 William Mead <william@m34d.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -84,20 +85,24 @@ class Warehouses extends DolibarrApi
|
|||
*
|
||||
* Get a list of warehouses
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @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 $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of warehouse objects
|
||||
* @since 4.0.0 Initial implementation
|
||||
* @since 23.0.0 Data pagination
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @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 $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
|
||||
* @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0*
|
||||
* @return array Array of warehouse objects
|
||||
* @phan-return Entrepot[]
|
||||
* @phpstan-return Entrepot[]
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '')
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '', $pagination_data = false)
|
||||
{
|
||||
$obj_ret = array();
|
||||
|
||||
|
|
@ -125,6 +130,9 @@ class Warehouses extends DolibarrApi
|
|||
}
|
||||
}
|
||||
|
||||
//this query will return total warehouses with the filters given
|
||||
$sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql);
|
||||
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0) {
|
||||
|
|
@ -152,6 +160,23 @@ class Warehouses extends DolibarrApi
|
|||
throw new RestException(503, 'Error when retrieve warehouse list : '.$this->db->lasterror());
|
||||
}
|
||||
|
||||
//if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit)
|
||||
if ($pagination_data) {
|
||||
$totalsResult = $this->db->query($sqlTotals);
|
||||
$total = $this->db->fetch_object($totalsResult)->total;
|
||||
|
||||
$tmp = $obj_ret;
|
||||
$obj_ret = [];
|
||||
|
||||
$obj_ret['data'] = $tmp;
|
||||
$obj_ret['pagination'] = [
|
||||
'total' => (int) $total,
|
||||
'page' => $page, //count starts from 0
|
||||
'page_count' => ceil((int) $total / $limit),
|
||||
'limit' => $limit
|
||||
];
|
||||
}
|
||||
|
||||
return $obj_ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -391,7 +391,21 @@ if ($action == 'createtask' && $user->hasRight('projet', 'creer')) {
|
|||
$taskid = $task->create($user);
|
||||
|
||||
if ($taskid > 0) {
|
||||
$result = $task->add_contact(GETPOSTINT("userid"), 'TASKEXECUTIVE', 'internal');
|
||||
$userid = GETPOSTINT("userid");
|
||||
if ($userid == -4) {
|
||||
if (empty($object->id)) {
|
||||
$object->fetch($projectid);
|
||||
}
|
||||
$contactlist = array();
|
||||
foreach (array('internal', 'external') as $source) {
|
||||
$contactlist = array_merge($contactlist, $object->liste_contact(-1, $source));
|
||||
}
|
||||
foreach ($contactlist as $key => $contact) {
|
||||
$result = $task->add_contact(((int) $contact["id"]), ($contact["code"] == "PROJECTLEADER" ? 'TASKEXECUTIVE' : "TASKCONTRIBUTOR"), $contact["source"]);
|
||||
}
|
||||
} else {
|
||||
$result = $task->add_contact(GETPOSTINT("userid"), 'TASKEXECUTIVE', 'internal');
|
||||
}
|
||||
} else {
|
||||
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("projects");
|
||||
|
|
@ -819,12 +833,12 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
|
|||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
||||
print img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
if (is_array($contactsofproject) && count($contactsofproject)) {
|
||||
print $form->select_dolusers($user->id, 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx');
|
||||
print $form->select_dolusers('-4', 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '(statut:=:1)', 4, '', 'maxwidth500 widthcentpercentminusx');
|
||||
} else {
|
||||
if ((isset($projectid) && $projectid > 0) || $object->id > 0) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoUserAssignedToTheProject").'</span>';
|
||||
} else {
|
||||
print $form->select_dolusers($user->id, 'userid', 0, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx');
|
||||
print $form->select_dolusers('-4', 'userid', 0, null, 0, '', '', '0', 0, 0, '(statut:=:1)', 4, '', 'maxwidth500 widthcentpercentminusx');
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
|
|||
|
|
@ -808,13 +808,13 @@ if ($id > 0 || !empty($ref)) {
|
|||
/*
|
||||
* Generated documents
|
||||
*/
|
||||
$filename = '';
|
||||
$filedir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$subdir = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->project->multidir_output[$object->entity]."/".$subdir;
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed = ($user->hasRight('projet', 'lire'));
|
||||
$delallowed = ($user->hasRight('projet', 'creer'));
|
||||
|
||||
print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
|
||||
print $formfile->showdocuments('project_task', $subdir, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0, '', '', '', '', '', $object);
|
||||
|
||||
// Show links to link elements
|
||||
$tmparray = $form->showLinkToObjectBlock($object, array(), array('project_task'), 1);
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ if ($action == 'create') {
|
|||
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
}
|
||||
|
||||
print dol_get_fiche_head(array(), '');
|
||||
print dol_get_fiche_head([], '');
|
||||
|
||||
print '<table class="border centpercent tableforfieldcreate">'."\n";
|
||||
|
||||
|
|
@ -370,7 +370,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = recruitmentCandidaturePrepareHead($object);
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("RecruitmentCandidature"), -1, $object->picto);
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("RecruitmentCandidature"), -1, $object->picto, 0, '', '', 0, '', 1);
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ if ($object->id && $upload_dir !== null) {
|
|||
*/
|
||||
$head = recruitmentCandidaturePrepareHead($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'document', $langs->trans("RecruitmentCandidature"), -1, $object->picto);
|
||||
print dol_get_fiche_head($head, 'document', $langs->trans("RecruitmentCandidature"), -1, $object->picto, 0, '', '', 0, '', 1);
|
||||
|
||||
|
||||
// Build file list
|
||||
|
|
|
|||
|
|
@ -241,7 +241,8 @@ if ($id > 0 || !empty($ref)) {
|
|||
$sql .= " t.libelle as type_label, t.subscription";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql .= " WHERE d.fk_soc = ".((int) $id);
|
||||
$sql .= " WHERE d.entity IN (".getEntity('member').")";
|
||||
$sql .= " AND d.fk_soc = ".((int) $id);
|
||||
$sql .= " AND d.fk_adherent_type = t.rowid";
|
||||
|
||||
dol_syslog("get list sql=".$sql);
|
||||
|
|
|
|||
|
|
@ -883,7 +883,7 @@ if (empty($reshook)) {
|
|||
$desc,
|
||||
(float) $pu_ht,
|
||||
(float) $qty,
|
||||
$tva_tx,
|
||||
$tva_tx, // don't cast to float
|
||||
$localtax1_tx,
|
||||
$localtax2_tx,
|
||||
$idprod,
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ if (isModEnabled('receiptprinter')) {
|
|||
print ' <span class="opacitymedium">('.$langs->trans("MainPrinterToUseMore").')</span>';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!$customprinterallowed) {
|
||||
if (!$customprinterallowed) { // @phpstan-ignore-line
|
||||
print '<span class="opacitymedium">'.$langs->trans("NotAvailableForCountryWhenModuleIsOn", $mysoc->country_code, $langs->transnoentitiesnoconv('Module3200Name')).'</span>';
|
||||
} else {
|
||||
print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$terminal), 1);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -1343,7 +1343,7 @@ if (!getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) {
|
|||
<?php
|
||||
|
||||
// Dependency modulecheck
|
||||
if (!isModEnabled('facture')) {
|
||||
if (!isModEnabled('invoice')) {
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Invoice")), null, 'errors');
|
||||
}
|
||||
|
||||
|
|
@ -1354,7 +1354,7 @@ if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) {
|
|||
$sql .= " AND active = 1";
|
||||
$sql .= " ORDER BY libelle";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$resql = $db->query($sql);
|
||||
$paiementsModes = array();
|
||||
if ($resql) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
|
|
@ -1449,7 +1449,7 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
|
|||
} else {
|
||||
$menus[$r++] = array('title' => '<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("PrintTicket").'</div>', 'action' => 'TakeposPrinting(placeid);');
|
||||
}
|
||||
} elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
|
||||
} elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { // @phpstan-ignore-line
|
||||
// Button Print Receipt on special printer
|
||||
$menus[$r++] = array('title' => '<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("PrintTicket").'</div>', 'action' => 'DolibarrTakeposPrinting(placeid);');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1331,7 +1331,7 @@ if (empty($reshook)) {
|
|||
} else {
|
||||
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposPrinting('.$placeid.')">'.$langs->trans('PrintTicket').'</button>';
|
||||
}
|
||||
} elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
|
||||
} elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { // @phpstan-ignore-line
|
||||
// If we set to use a specific receipt printer
|
||||
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="DolibarrTakeposPrinting('.$placeid.')">'.$langs->trans('PrintTicket').'</button>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -339,9 +339,9 @@ if ($user->hasRight('ticket', 'read')) {
|
|||
$sql .= " category.code as category_code, category.label as category_label,";
|
||||
$sql .= " severity.code as severity_code, severity.label as severity_label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code=t.severity_code";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code = t.type_code AND type.entity = t.entity";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code = t.category_code AND category.entity = t.entity";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code = t.severity_code AND severity.entity = t.entity";
|
||||
if (!$user->hasRight('societe', 'client', 'voir')) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,7 +763,7 @@ class Users extends DolibarrApi
|
|||
throw new RestException(404, 'Group not found');
|
||||
}
|
||||
|
||||
return $this->_cleanObjectDatas($group_static);
|
||||
return $this->_cleanUserGroup($group_static);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1148,6 +1148,109 @@ class Users extends DolibarrApi
|
|||
return $object;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible usergroup object datas
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
private function _cleanUserGroup($object)
|
||||
{
|
||||
// phpcs:enable
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->actiontypecode);
|
||||
unset($object->all_permissions_are_loaded);
|
||||
unset($object->array_languages);
|
||||
unset($object->array_options);
|
||||
unset($object->barcode_type_coder);
|
||||
unset($object->barcode_type);
|
||||
unset($object->canvas);
|
||||
unset($object->civility_code);
|
||||
unset($object->civility_id);
|
||||
unset($object->clicktodial_loaded);
|
||||
unset($object->cond_reglement_id);
|
||||
unset($object->cond_reglement_supplier_id);
|
||||
unset($object->contact_id);
|
||||
unset($object->contacts_ids_internal);
|
||||
unset($object->contacts_ids);
|
||||
unset($object->country_code);
|
||||
unset($object->country_id);
|
||||
unset($object->date_cloture);
|
||||
unset($object->date_creation);
|
||||
unset($object->date_modification);
|
||||
unset($object->date_validation);
|
||||
unset($object->default_values);
|
||||
unset($object->demand_reason_id);
|
||||
unset($object->deposit_percent);
|
||||
unset($object->extraparams);
|
||||
unset($object->firstname);
|
||||
unset($object->fk_account);
|
||||
unset($object->fk_delivery_address);
|
||||
unset($object->fk_incoterms);
|
||||
unset($object->fk_multicurrency);
|
||||
unset($object->fk_project);
|
||||
unset($object->fk_user_creat);
|
||||
unset($object->fk_user_modif);
|
||||
unset($object->globalgroup);
|
||||
unset($object->import_key);
|
||||
unset($object->last_main_doc);
|
||||
unset($object->lastname);
|
||||
unset($object->lastsearch_values_tmp);
|
||||
unset($object->lastsearch_values);
|
||||
unset($object->ldap_sid);
|
||||
unset($object->libelle_incoterms);
|
||||
unset($object->lines);
|
||||
unset($object->linkedObjectsIds);
|
||||
unset($object->location_incoterms);
|
||||
unset($object->members);
|
||||
unset($object->mode_reglement_id);
|
||||
unset($object->module);
|
||||
unset($object->multicurrency_code);
|
||||
unset($object->multicurrency_total_ht);
|
||||
unset($object->multicurrency_total_localtax1);
|
||||
unset($object->multicurrency_total_localtax2);
|
||||
unset($object->multicurrency_total_ttc);
|
||||
unset($object->multicurrency_total_tva);
|
||||
unset($object->multicurrency_tx);
|
||||
unset($object->nb_rights);
|
||||
unset($object->nb_users);
|
||||
unset($object->origin_id);
|
||||
unset($object->origin_type);
|
||||
unset($object->product);
|
||||
unset($object->ref_ext);
|
||||
unset($object->ref);
|
||||
unset($object->region_id);
|
||||
unset($object->retained_warranty_fk_cond_reglement);
|
||||
unset($object->rights);
|
||||
unset($object->search_sid);
|
||||
unset($object->shipping_method_id);
|
||||
unset($object->shipping_method);
|
||||
unset($object->specimen);
|
||||
unset($object->state_id);
|
||||
unset($object->status);
|
||||
unset($object->statut);
|
||||
unset($object->total_ht);
|
||||
unset($object->total_localtax1);
|
||||
unset($object->total_localtax2);
|
||||
unset($object->total_ttc);
|
||||
unset($object->total_tva);
|
||||
unset($object->totalpaid_multicurrency);
|
||||
unset($object->totalpaid);
|
||||
unset($object->transport_mode_id);
|
||||
unset($object->TRIGGER_PREFIX);
|
||||
unset($object->user_closing_id);
|
||||
unset($object->user_creation_id);
|
||||
unset($object->user_modification_id);
|
||||
unset($object->user_validation_id);
|
||||
unset($object->user);
|
||||
unset($object->usergroup_entity);
|
||||
unset($object->warehouse_id);
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean sensible user group list datas
|
||||
*
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ class UserGroup extends CommonObject
|
|||
}
|
||||
|
||||
$this->name = $this->nom; // For compatibility with field name
|
||||
$this->note_private = $this->note; // For compatibility with old field note
|
||||
|
||||
if ($result) {
|
||||
if ($load_members) {
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ if ($object->id && $upload_dir !== null) {
|
|||
}
|
||||
$head = user_prepare_head($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'document', $langs->trans("User"), -1, 'user');
|
||||
print dol_get_fiche_head($head, 'document', $langs->trans("User"), -1, 'user', 0, '', '', 0, '', 1);
|
||||
|
||||
$linkback = '';
|
||||
if ($user->hasRight("user", "user", "read") || $user->admin) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue