Merge remote-tracking branch 'upstream/develop' into 17b15
This commit is contained in:
commit
a3e34f20e0
@ -718,9 +718,12 @@ class AccountancyExport
|
||||
|
||||
/**
|
||||
* Export format : WinFic - eWinfic - WinSis Compta
|
||||
* Last review for this format : 2022-11-01 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf
|
||||
*
|
||||
* @param array $TData data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportWinfic(&$TData)
|
||||
@ -728,10 +731,14 @@ class AccountancyExport
|
||||
global $conf;
|
||||
|
||||
$end_line = "\r\n";
|
||||
$index = 1;
|
||||
|
||||
//We should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
|
||||
// Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted
|
||||
|
||||
foreach ($TData as $data) {
|
||||
$code_compta = $data->numero_compte;
|
||||
if (!empty($data->subledger_account)) {
|
||||
@ -740,7 +747,7 @@ class AccountancyExport
|
||||
|
||||
$Tab = array();
|
||||
//$Tab['type_ligne'] = 'M';
|
||||
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
|
||||
$Tab['code_journal'] = str_pad(dol_trunc($data->code_journal, 2, 'right', 'UTF-8', 1), 2);
|
||||
|
||||
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
|
||||
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
|
||||
@ -749,11 +756,11 @@ class AccountancyExport
|
||||
|
||||
$Tab['folio'] = ' 1';
|
||||
|
||||
$Tab['num_ecriture'] = str_pad(self::trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_ecriture'] = str_pad(dol_trunc($index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT);
|
||||
|
||||
$Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
|
||||
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0');
|
||||
$Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6, 'right', 'UTF-8', 1), 6, '0');
|
||||
|
||||
if ($data->sens == 'D') {
|
||||
$Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
||||
@ -765,11 +772,11 @@ class AccountancyExport
|
||||
$Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30);
|
||||
$Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30, 'right', 'UTF-8', 1), 30);
|
||||
|
||||
$Tab['lettrage'] = str_repeat(' ', 2);
|
||||
$Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left', 'UTF-8', 1), 2);
|
||||
|
||||
$Tab['code_piece'] = str_repeat(' ', 5);
|
||||
$Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5, 'left', 'UTF-8', 1), 5, ' ', STR_PAD_LEFT);
|
||||
|
||||
$Tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
@ -793,6 +800,8 @@ class AccountancyExport
|
||||
$Tab['end_line'] = $end_line;
|
||||
|
||||
print implode('|', $Tab);
|
||||
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ if ($user->socid > 0) {
|
||||
}
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ if ($user->socid > 0) {
|
||||
}
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ if ($user->socid > 0) {
|
||||
}
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
|
||||
@ -182,7 +182,39 @@ if ($action == 'updateMask') {
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') {
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
||||
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
/*elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') {
|
||||
// Activate ask for payment bank
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
@ -208,7 +240,8 @@ if ($action == 'updateMask') {
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@ -636,6 +669,13 @@ print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMAR
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
|
||||
print '<td class="center" colspan="2">';
|
||||
print ajax_constantonoff('ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td></tr>';
|
||||
print '</form>';
|
||||
|
||||
/*
|
||||
|
||||
@ -55,6 +55,8 @@ if (empty($conf->global->CONTRACT_ADDON)) {
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
$error=0;
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconst = GETPOST('maskconstcontract', 'alpha');
|
||||
$maskvalue = GETPOST('maskcontract', 'alpha');
|
||||
@ -158,10 +160,37 @@ if ($action == 'updateMask') {
|
||||
if (!dolibarr_set_const($db, "CONTRACT_ALLOW_ONLINESIGN", $value, 0, 'int', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
} elseif ($action == "allowexternaldownload") {
|
||||
if (!dolibarr_set_const($db, "CONTRACT_ALLOW_EXTERNAL_DOWNLOAD", $value, 0, 'int', $conf->entity)) {
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
||||
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -504,16 +533,8 @@ print '</tr>';
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
|
||||
print '<td class="center">';
|
||||
if ($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowexternaldownload&token='.newToken().'&value=0">';
|
||||
print img_picto($langs->trans("Activited"), 'switch_on');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowexternaldownload&token='.newToken().'&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print '<td class="center" colspan="2">';
|
||||
print ajax_constantonoff('CONTRACT_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
@ -232,6 +232,37 @@ if ($action == 'updateMask') {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
||||
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -771,20 +802,15 @@ print '</form>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("InvoiceCheckPosteriorDate"). ' ' ;
|
||||
print $form->textwithpicto('', $langs->trans("InvoiceCheckPosteriorDateHelp"), 1, 'help') . '</td>';
|
||||
print '<td class="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE');
|
||||
} else {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
print '<input type="hidden" name="action" value="set_INVOICE_CHECK_POSTERIOR_DATE" />';
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_CHECK_POSTERIOR_DATE", $arrval, $conf->global->INVOICE_CHECK_POSTERIOR_DATE);
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
|
||||
print '</form>';
|
||||
}
|
||||
print '<td class="left" colspan="2">';
|
||||
print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE');
|
||||
print '</td></tr>';
|
||||
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
|
||||
print '<td class="left" colspan="2">';
|
||||
print ajax_constantonoff('INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -625,6 +625,15 @@ print '<td class="right"><input type="submit" class="button button-edit" value="
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
|
||||
print '<td class="center" colspan="2">';
|
||||
print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
// default update prices on cloning a proposal
|
||||
/*
|
||||
print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
|
||||
@ -178,6 +178,37 @@ if ($action == 'set') {
|
||||
// par appel methode canBeActivated
|
||||
|
||||
dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
||||
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -502,21 +533,20 @@ print '</form>';
|
||||
if (isModEnabled('banque')) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td> </td><td class="right">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
|
||||
} else {
|
||||
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&token='.newToken().'&value=1">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
} else {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&token='.newToken().'&value=0">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
|
||||
}
|
||||
}
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td> </td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
|
||||
}
|
||||
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td><td> </td>';
|
||||
print '<td class="right">';
|
||||
print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
@ -612,10 +612,10 @@ class Setup extends DolibarrApi
|
||||
* @param object $object Object with label to translate
|
||||
* @param string $lang Code of the language the name of the object must be translated to
|
||||
* @param string $prefix Prefix for translation key
|
||||
*
|
||||
* @param array $dict Array of dictionnary for translation
|
||||
* @return void
|
||||
*/
|
||||
private function translateLabel($object, $lang, $prefix = 'Country')
|
||||
private function translateLabel($object, $lang, $prefix = 'Country', $dict = array('dict'))
|
||||
{
|
||||
if (!empty($lang)) {
|
||||
// Load the translations if this is a new language.
|
||||
@ -623,7 +623,7 @@ class Setup extends DolibarrApi
|
||||
global $conf;
|
||||
$this->translations = new Translate('', $conf);
|
||||
$this->translations->setDefaultLang($lang);
|
||||
$this->translations->load('dict');
|
||||
$this->translations->loadLangs($dict);
|
||||
}
|
||||
if ($object->code) {
|
||||
$key = $prefix.$object->code;
|
||||
@ -636,7 +636,6 @@ class Setup extends DolibarrApi
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the list of events types.
|
||||
*
|
||||
@ -779,6 +778,7 @@ class Setup extends DolibarrApi
|
||||
* @param string $type To filter on type of contact
|
||||
* @param string $module To filter on module contacts
|
||||
* @param int $active Contact's type is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the civility must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of Contacts types
|
||||
*
|
||||
@ -786,7 +786,7 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '')
|
||||
public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@ -827,7 +827,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$contact_type = $this->db->fetch_object($result);
|
||||
$this->translateLabel($contact_type, $lang, 'TypeContact_'.$contact_type->type.'_'.$contact_type->source.'_', array("eventorganization", "resource", "projects", "contracts", "bills", "orders", "agenda", "propal", "stocks", "supplier_proposal", "interventions", "sendings", "ticket"));
|
||||
$list[] = $contact_type;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of contacts types : '.$this->db->lasterror());
|
||||
@ -845,6 +847,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param string $module To filter on module events
|
||||
* @param int $active Civility is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the civility must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of civility types
|
||||
*
|
||||
@ -852,7 +855,7 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '')
|
||||
public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@ -890,7 +893,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$civility = $this->db->fetch_object($result);
|
||||
$this->translateLabel($civility, $lang, 'Civility', array('dict'));
|
||||
$list[] = $civility;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of civility : '.$this->db->lasterror());
|
||||
@ -1188,6 +1193,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number {@min 0}
|
||||
* @param int $active Shipping methodsm is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the method must be translated to
|
||||
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
|
||||
*
|
||||
* @url GET dictionary/shipping_methods
|
||||
@ -1196,7 +1202,7 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 400
|
||||
*/
|
||||
public function getShippingModes($limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
public function getShippingModes($limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@ -1232,7 +1238,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$method = $this->db->fetch_object($result);
|
||||
$this->translateLabel($method, $lang, '', array('dict'));
|
||||
$list[] = $method;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
@ -1496,6 +1504,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the category must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of ticket categories
|
||||
*
|
||||
@ -1503,13 +1512,14 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT rowid, code, pos, label, use_default, description";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category as t";
|
||||
$sql .= " WHERE t.active = ".((int) $active);
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_ticket_category').")";
|
||||
$sql .= " AND t.active = ".((int) $active);
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
$errormessage = '';
|
||||
@ -1538,7 +1548,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$category = $this->db->fetch_object($result);
|
||||
$this->translateLabel($category, $lang, 'TicketCategoryShort', array('ticket'));
|
||||
$list[] = $category;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of ticket categories : '.$this->db->lasterror());
|
||||
@ -1555,6 +1567,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the severity must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of ticket severities
|
||||
*
|
||||
@ -1562,13 +1575,14 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT rowid, code, pos, label, use_default, color, description";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_severity as t";
|
||||
$sql .= " WHERE t.active = ".((int) $active);
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_ticket_severity').")";
|
||||
$sql .= " AND t.active = ".((int) $active);
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
$errormessage = '';
|
||||
@ -1597,7 +1611,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$severity = $this->db->fetch_object($result);
|
||||
$this->translateLabel($severity, $lang, 'TicketSeverityShort', array('ticket'));
|
||||
$list[] = $severity;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of ticket severities : '.$this->db->lasterror());
|
||||
@ -1614,6 +1630,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the type must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of ticket types
|
||||
*
|
||||
@ -1621,15 +1638,15 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT rowid, code, pos, label, use_default, description";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type as t";
|
||||
$sql .= " WHERE t.active = ".(int) $active;
|
||||
// if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'";
|
||||
// if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_ticket_type').")";
|
||||
$sql .= " AND t.active = ".((int) $active);
|
||||
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
$errormessage = '';
|
||||
@ -1658,7 +1675,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$type =$this->db->fetch_object($result);
|
||||
$this->translateLabel($type, $lang, 'TicketTypeShort', array('ticket'));
|
||||
$list[] = $type;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of ticket types : '.$this->db->lasterror());
|
||||
|
||||
@ -704,7 +704,7 @@ if (empty($reshook)) {
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=bom', 'clone', $permissiontoadd);
|
||||
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : "").'&action=clone&object=bom', 'clone', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Close / Cancel
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -186,7 +186,7 @@ if ($action == 'create') {
|
||||
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
|
||||
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
|
||||
|
||||
// Owner
|
||||
// Visibility / Owner
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx');
|
||||
print '</td><td class="hideonsmartphone"></td></tr>';
|
||||
@ -279,9 +279,10 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility / owner
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($action == 'edit' && $user->admin) {
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx');
|
||||
} else {
|
||||
if ($object->fk_user > 0) {
|
||||
$fuser = new User($db);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -39,13 +39,14 @@ $id = GETPOST("id", 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@ -72,6 +73,14 @@ $permissiontodelete = !empty($user->rights->bookmark->supprimer);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
if ($action == 'delete') {
|
||||
$res = $object->remove($id);
|
||||
if ($res > 0) {
|
||||
@ -103,34 +112,41 @@ if (!$user->admin) {
|
||||
$sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
|
||||
}
|
||||
|
||||
$sql .= $db->order($sortfield.", position", $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
|
||||
$resql = $db->query($sqlforcount);
|
||||
if ($resql) {
|
||||
$objforcount = $db->fetch_object($resql);
|
||||
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
|
||||
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
|
||||
$num = $nbtotalofrecords;
|
||||
} else {
|
||||
|
||||
// Complete request and execute it with limit
|
||||
$sql .= $db->order($sortfield.", position", $sortorder);
|
||||
if ($limit) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
}
|
||||
|
||||
$param = "";
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
@ -138,7 +154,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param = '&optioncss='.urlencode($optioncss);
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
@ -150,7 +166,7 @@ $arrayofmassactions = array(
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
);
|
||||
if ($permissiontodelete) {
|
||||
if (!empty($permissiontodelete)) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
@ -158,7 +174,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
@ -167,7 +183,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer));
|
||||
@ -179,13 +197,13 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
//print "<td> </td>";
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Target", '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -205,33 +223,31 @@ while ($i < min($num, $limit)) {
|
||||
print $object->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
$linkintern = 0;
|
||||
$linkintern = 1;
|
||||
if (preg_match('/^http/i', $obj->url)) {
|
||||
$linkintern = 0;
|
||||
}
|
||||
$title = $obj->title;
|
||||
$link = $obj->url;
|
||||
$canedit = $user->rights->bookmark->supprimer;
|
||||
$candelete = $user->rights->bookmark->creer;
|
||||
|
||||
// Title
|
||||
print "<td>";
|
||||
$linkintern = 1;
|
||||
if ($linkintern) {
|
||||
print '<a href="'.$obj->url.'">';
|
||||
}
|
||||
print $title;
|
||||
if ($linkintern) {
|
||||
print "</a>";
|
||||
}
|
||||
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
|
||||
print dol_escape_htmltag($title);
|
||||
print "</td>\n";
|
||||
|
||||
// Url
|
||||
print '<td class="tdoverflowmax200">';
|
||||
if (!$linkintern) {
|
||||
print '<a href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
|
||||
if (empty($linkintern)) {
|
||||
print img_picto('', 'url', 'class="pictofixedwidth"');
|
||||
print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
|
||||
} else {
|
||||
//print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
|
||||
print '<a class="" href="'.$obj->url.'">';
|
||||
}
|
||||
print $link;
|
||||
if (!$linkintern) {
|
||||
print '</a>';
|
||||
}
|
||||
print '</a>';
|
||||
print "</td>\n";
|
||||
|
||||
// Target
|
||||
@ -264,7 +280,7 @@ while ($i < min($num, $limit)) {
|
||||
print "</td>\n";
|
||||
|
||||
// Date creation
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
|
||||
print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
|
||||
|
||||
// Position
|
||||
print '<td class="right">'.$obj->position."</td>";
|
||||
|
||||
@ -2148,6 +2148,15 @@ if ($id > 0) {
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewPerUser").'</span>';
|
||||
$linkback .= '</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$linkback .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$linkback = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
//$linkback.=$out;
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
|
||||
@ -63,6 +63,9 @@ if ($id > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('actioncard', 'globalcard'));
|
||||
|
||||
// Get parameters
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@ -155,6 +158,15 @@ if ($object->id > 0) {
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$out .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$out = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
|
||||
@ -39,6 +39,9 @@ $langs->load("commercial");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('actioncard', 'globalcard'));
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
$action = '';
|
||||
@ -83,6 +86,15 @@ $out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.do
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$out .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$out = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
|
||||
@ -1791,13 +1791,13 @@ if ($action == 'create') {
|
||||
// Terms of payment
|
||||
print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||
print img_picto('', 'paiment');
|
||||
print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', (GETPOSTISSET('cond_reglement_id_deposit_percent') ? GETPOST('cond_reglement_id_deposit_percent', 'alpha') : $soc->deposit_percent));
|
||||
print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id', 'int') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', (GETPOSTISSET('cond_reglement_id_deposit_percent') ? GETPOST('cond_reglement_id_deposit_percent', 'alpha') : $soc->deposit_percent));
|
||||
print '</td></tr>';
|
||||
|
||||
// Mode of payment
|
||||
print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
|
||||
print img_picto('', 'bank', 'class="pictofixedwidth"');
|
||||
print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
|
||||
print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id', 'int') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
|
||||
@ -466,7 +466,7 @@ if ($action == "nosign" && $permissiontoclose) {
|
||||
$error = 0;
|
||||
foreach ($toselect as $checked) {
|
||||
if ($tmpproposal->fetch($checked) > 0) {
|
||||
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
||||
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED || (!empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) && $tmpproposal->statut == $tmpproposal::STATUS_DRAFT)) {
|
||||
$tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED;
|
||||
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
|
||||
setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs');
|
||||
@ -1687,6 +1687,9 @@ if ($resql) {
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
@ -2231,10 +2234,11 @@ if ($resql) {
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -1973,6 +1973,10 @@ if ($resql) {
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Ref
|
||||
@ -2215,7 +2219,11 @@ if ($resql) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'c.total_tva';
|
||||
}
|
||||
$totalarray['val']['c.total_tva'] += $obj->total_tva;
|
||||
if (isset($totalarray['val']['c.total_tva'])) {
|
||||
$totalarray['val']['c.total_tva'] += $obj->total_tva;
|
||||
} else {
|
||||
$totalarray['val']['c.total_tva'] = $obj->total_tva;
|
||||
}
|
||||
}
|
||||
|
||||
// Amount TTC / gross
|
||||
@ -2227,7 +2235,11 @@ if ($resql) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'c.total_ttc';
|
||||
}
|
||||
$totalarray['val']['c.total_ttc'] += $obj->total_ttc;
|
||||
if (isset($totalarray['val']['c.total_ttc'])) {
|
||||
$totalarray['val']['c.total_ttc'] += $obj->total_ttc;
|
||||
} else {
|
||||
$totalarray['val']['c.total_ttc'] = $obj->total_ttc;
|
||||
}
|
||||
}
|
||||
|
||||
// Currency
|
||||
@ -2588,10 +2600,10 @@ if ($resql) {
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -65,7 +65,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -62,7 +62,7 @@ if ($userid > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -64,7 +64,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -74,7 +74,7 @@ llxHeader('', $langs->trans("PurchasesJournal"), '', '', 0, 0, '', '', $morequer
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
|
||||
@ -77,7 +77,7 @@ $morequery = '&date_startyear='.$date_startyear.'&date_startmonth='.$date_startm
|
||||
llxHeader('', $langs->trans("SellsJournal"), '', '', 0, 0, '', '', $morequery);
|
||||
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
|
||||
@ -39,7 +39,7 @@ $local = GETPOST('localTaxType', 'int');
|
||||
// Date range
|
||||
$year = GETPOST("year", "int");
|
||||
if (empty($year)) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year_start = $year_current;
|
||||
} else {
|
||||
$year_current = $year;
|
||||
|
||||
@ -38,7 +38,7 @@ $localTaxType = GETPOST('localTaxType', 'int');
|
||||
// Date range
|
||||
$year = GETPOST("year", "int");
|
||||
if (empty($year)) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year_start = $year_current;
|
||||
} else {
|
||||
$year_current = $year;
|
||||
|
||||
@ -49,7 +49,7 @@ $local = GETPOST('localTaxType', 'int');
|
||||
// Date range
|
||||
$year = GETPOST("year", "int");
|
||||
if (empty($year)) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year_start = $year_current;
|
||||
} else {
|
||||
$year_current = $year;
|
||||
|
||||
@ -59,7 +59,7 @@ $nbofyear = 1;
|
||||
// Date range
|
||||
$year = GETPOST('year', 'int');
|
||||
if (empty($year)) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$month_current = strftime("%m", dol_now());
|
||||
$year_start = $year_current - ($nbofyear - 1);
|
||||
} else {
|
||||
|
||||
@ -371,7 +371,7 @@ print '</tr>';
|
||||
$now_show_delta = 0;
|
||||
$minyear = substr($minyearmonth, 0, 4);
|
||||
$maxyear = substr($maxyearmonth, 0, 4);
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$nowyearmonth = strftime("%Y-%m", dol_now());
|
||||
$maxyearmonth = max($maxyearmonth, $nowyearmonth);
|
||||
$now = dol_now();
|
||||
|
||||
@ -310,7 +310,7 @@ print '</tr>';
|
||||
$now_show_delta = 0;
|
||||
$minyear = substr($minyearmonth, 0, 4);
|
||||
$maxyear = substr($maxyearmonth, 0, 4);
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$nowyearmonth = strftime("%Y-%m", dol_now());
|
||||
$maxyearmonth = max($maxyearmonth, $nowyearmonth);
|
||||
$now = dol_now();
|
||||
|
||||
@ -435,7 +435,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) {
|
||||
$newlang = GETPOST('lang_id', 'aZ09');
|
||||
}
|
||||
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
$newlang = !empty($object->thirdparty->default_lang) ? $object->thirdparty->default_lang : "";
|
||||
}
|
||||
if (!empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
|
||||
@ -1240,6 +1240,50 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) {
|
||||
$db->begin();
|
||||
if (GETPOSTISSET('pricerate')) {
|
||||
$pricepercentage=GETPOST('pricerate', 'int');
|
||||
if ($pricepercentage == 0) {
|
||||
setEventMessages($langs->trans("RecordsModified", 0), null);
|
||||
} else {
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $object->fetch($toselectid);
|
||||
//var_dump($contcats);exit;
|
||||
if ($result > 0) {
|
||||
if ($obj->price_base_type == 'TTC') {
|
||||
$newprice = $object->price_ttc * (100 + $pricepercentage) / 100;
|
||||
$minprice = $object->price_min_ttc;
|
||||
} else {
|
||||
$newprice = $object->price * (100 + $pricepercentage) / 100;
|
||||
$minprice = $object->price_min;
|
||||
}
|
||||
$res = $object->updatePrice($newprice, $obj->price_base_type, $user, $object->tva_tx, $minprice, 0, $object->tva_npr, 0, 0, array(), $object->default_vat_code);
|
||||
if ($res > 0) {
|
||||
$nbok++;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if ($nbok > 0) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null);
|
||||
}
|
||||
$db->commit();
|
||||
$toselect=array();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiontoadd) {
|
||||
$db->begin();
|
||||
$supervisortoset=GETPOST('supervisortoset');
|
||||
|
||||
@ -2193,7 +2193,7 @@ abstract class CommonObject
|
||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql .= " AND ug.fk_user = te.rowid";
|
||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
||||
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||
}
|
||||
} else {
|
||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||
@ -2263,7 +2263,7 @@ abstract class CommonObject
|
||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql .= " AND ug.fk_user = te.rowid";
|
||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
||||
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||
}
|
||||
} else {
|
||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||
|
||||
@ -113,7 +113,8 @@ class EvalMath
|
||||
|
||||
// constants
|
||||
public $fb = array( // built-in functions
|
||||
'sin', 'sinh', 'arcsin', 'asin', 'arcsinh', 'asinh', 'cos', 'cosh', 'arccos', 'acos', 'arccosh', 'acosh', 'tan', 'tanh', 'arctan', 'atan', 'arctanh', 'atanh', 'sqrt', 'abs', 'ln', 'log', 'intval');
|
||||
'sin', 'sinh', 'arcsin', 'asin', 'arcsinh', 'asinh', 'cos', 'cosh', 'arccos', 'acos', 'arccosh', 'acosh', 'tan', 'tanh', 'arctan', 'atan', 'arctanh', 'atanh', 'sqrt', 'abs', 'ln', 'log', 'intval', 'ceil',
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -5070,7 +5070,7 @@ class Form
|
||||
$more .= $input['label'].'</div><div class="tagtd left">';
|
||||
}
|
||||
if ($input['type'] == 'select') {
|
||||
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss);
|
||||
$more .= $this->selectarray($input['name'], $input['values'], !empty($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss);
|
||||
} else {
|
||||
$more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr);
|
||||
}
|
||||
|
||||
@ -96,6 +96,9 @@ class FormCron extends Form
|
||||
|
||||
$out .= '</SELECT>';
|
||||
}
|
||||
if (empty($readonly)) {
|
||||
$out .= ajax_combobox($htmlname);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -841,7 +841,7 @@ class FormFile
|
||||
|
||||
$out .= '<td class="minwidth200 tdoverflowmax300">';
|
||||
if ($imgpreview) {
|
||||
$out .= '<span class="spanoverflow widthcentpercentminusx">';
|
||||
$out .= '<span class="spanoverflow widthcentpercentminusx valignmiddle">';
|
||||
} else {
|
||||
$out .= '<span class="spanoverflow">';
|
||||
}
|
||||
|
||||
@ -689,10 +689,10 @@ class FormProjets
|
||||
$sellist .= '<option value="-1"> </option>';
|
||||
}
|
||||
if ($showallnone) {
|
||||
$sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").' --</option>';
|
||||
$sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").' --</option>';
|
||||
$sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").' --</option>';
|
||||
$sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").' --</option>';
|
||||
$sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").'</option>';
|
||||
$sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").'</option>';
|
||||
$sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").'</option>';
|
||||
$sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").'</option>';
|
||||
}
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
@ -304,7 +304,7 @@ function getDefaultDatesForTransfer()
|
||||
$date_end = dol_get_last_day($year_end, $month_end);
|
||||
}
|
||||
} elseif ($periodbydefaultontransfer == 1) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$pastmonth = strftime("%m", dol_now());
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
@ -312,7 +312,7 @@ function getDefaultDatesForTransfer()
|
||||
$pastmonthyear--;
|
||||
}
|
||||
} else {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
|
||||
@ -267,9 +267,23 @@ function societe_prepare_head(Societe $object)
|
||||
if (!empty($user->rights->partnership->read)) {
|
||||
$langs->load("partnership");
|
||||
$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/partnership.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Partnership");
|
||||
$head[$h][2] = 'partnership';
|
||||
$head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Partnerships");
|
||||
$nbNote = 0;
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."partnership as n";
|
||||
$sql .= " WHERE fk_soc = ".((int) $object->id);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbNote = $obj->nb;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'partnerships';
|
||||
if ($nbPartnership > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>';
|
||||
}
|
||||
|
||||
@ -1159,29 +1159,43 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of instance of object (new instance with same value for properties)
|
||||
* With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object may not be valid.
|
||||
* Create a clone of instance of object (new instance with same value for each properties)
|
||||
* With native = 0: Property that are reference are different memory area in the new object (full isolation clone). This means $this->db of new object may not be valid.
|
||||
* With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db of new object is still valid but point to same this->db than original object.
|
||||
* With native = 2: Property that are reference are different memory area in the new object (full isolation clone). Only scalar and array values are cloned. This means $this->db of new object is not valid.
|
||||
*
|
||||
* @param object $object Object to clone
|
||||
* @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method+destroy non scalar or array properties (recommended)
|
||||
* @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method keeping only scalar and array properties (recommended)
|
||||
* @return object Clone object
|
||||
* @see https://php.net/manual/language.oop5.cloning.php
|
||||
*/
|
||||
function dol_clone($object, $native = 0)
|
||||
{
|
||||
if ($native == 0) {
|
||||
// deprecated method, use the method with native = 2 instead
|
||||
$tmpsavdb = null;
|
||||
if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') {
|
||||
$tmpsavdb = $object->db;
|
||||
unset($object->db); // Such property can not be serialized with pgsl (when object->db->db = 'PgSql\Connection')
|
||||
}
|
||||
|
||||
$myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields
|
||||
$myclone = unserialize(serialize($object)); // serialize then unserialize is a hack to be sure to have a new object for all fields
|
||||
|
||||
if (!empty($tmpsavdb)) {
|
||||
$object->db = $tmpsavdb;
|
||||
}
|
||||
} elseif ($native == 2) {
|
||||
// recommended method to have a full isolated cloned object
|
||||
$myclone = new stdClass();
|
||||
$tmparray = get_object_vars($object); // return only public properties
|
||||
|
||||
if (is_array($tmparray)) {
|
||||
foreach ($tmparray as $propertykey => $propertyval) {
|
||||
if (is_scalar($propertyval) || is_array($propertyval)) {
|
||||
$myclone->$propertykey = $propertyval;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable)
|
||||
}
|
||||
@ -4072,7 +4086,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss',
|
||||
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
||||
'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
||||
'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
||||
'conferenceorbooth', 'eventorganization'
|
||||
))) {
|
||||
$fakey = $pictowithouttext;
|
||||
@ -4121,7 +4135,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'supplier'=>'building', 'technic'=>'cogs',
|
||||
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'vat'=>'money-check-alt', 'vcard'=>'address-card',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'url'=>'external-link-alt', 'vat'=>'money-check-alt', 'vcard'=>'address-card',
|
||||
'jabber'=>'comment-o',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock',
|
||||
'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram'
|
||||
|
||||
@ -66,9 +66,23 @@ function member_prepare_head(Adherent $object)
|
||||
if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') {
|
||||
if (!empty($user->rights->partnership->read)) {
|
||||
$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/partnership.php?rowid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Partnership");
|
||||
$head[$h][2] = 'partnership';
|
||||
$head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?rowid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Partnerships");
|
||||
$nbNote = 0;
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."partnership as n";
|
||||
$sql .= " WHERE fk_member = ".((int) $object->id);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbNote = $obj->nb;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'partnerships';
|
||||
if ($nbPartnership > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>';
|
||||
}
|
||||
|
||||
@ -1611,7 +1611,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
|
||||
// Duration
|
||||
print '<td class="center duration'.($cssonholiday ? ' '.$cssonholiday : '').($cssweekend ? ' '.$cssweekend : '').'">';
|
||||
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id];
|
||||
$dayWorkLoad = !empty($projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id]) ? $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id] : 0;
|
||||
if (!isset($totalforeachday[$preselectedday])) $totalforeachday[$preselectedday] = 0;
|
||||
$totalforeachday[$preselectedday] += $dayWorkLoad;
|
||||
|
||||
$alreadyspent = '';
|
||||
@ -1992,7 +1993,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
$modeinput = 'hours';
|
||||
for ($idw = 0; $idw < 7; $idw++) {
|
||||
$tmpday = dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||
|
||||
if (!isset($totalforeachday[$tmpday])) $totalforeachday[$tmpday] = 0;
|
||||
$cssonholiday = '';
|
||||
if (!$isavailable[$tmpday]['morning'] && !$isavailable[$tmpday]['afternoon']) {
|
||||
$cssonholiday .= 'onholidayallday ';
|
||||
@ -2003,14 +2004,14 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
}
|
||||
|
||||
$tmparray = dol_getdate($tmpday);
|
||||
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id];
|
||||
$dayWorkLoad = (!empty($projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id]) ? $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id] : 0);
|
||||
$totalforeachday[$tmpday] += $dayWorkLoad;
|
||||
|
||||
$alreadyspent = '';
|
||||
if ($dayWorkLoad > 0) {
|
||||
$alreadyspent = convertSecondToTime($dayWorkLoad, 'allhourmin');
|
||||
}
|
||||
$alttitle = $langs->trans("AddHereTimeSpentForDay", $tmparray['day'], $tmparray['mon']);
|
||||
$alttitle = $langs->trans("AddHereTimeSpentForDay", !empty($tmparray['day']) ? $tmparray['day'] : 0, $tmparray['mon']);
|
||||
|
||||
global $numstartworkingday, $numendworkingday;
|
||||
$cssweekend = '';
|
||||
@ -2290,7 +2291,8 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
|
||||
$year = $firstdaytoshowarray['year'];
|
||||
$month = $firstdaytoshowarray['mon'];
|
||||
foreach ($TWeek as $weekIndex => $weekNb) {
|
||||
$weekWorkLoad = $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id];
|
||||
$weekWorkLoad = !empty($projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]) ? $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id] : 0 ;
|
||||
if (!isset($totalforeachweek[$weekNb])) $totalforeachweek[$weekNb] = 0;
|
||||
$totalforeachweek[$weekNb] += $weekWorkLoad;
|
||||
|
||||
$alreadyspent = '';
|
||||
@ -2449,6 +2451,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
||||
|
||||
$arrayidtypeofcontact = array();
|
||||
|
||||
print '<!-- print_projecttasks_array -->';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
@ -2648,12 +2651,12 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
||||
$plannedworkload = $objp->planned_workload;
|
||||
$total_plannedworkload += $plannedworkload;
|
||||
if (!in_array('plannedworkload', $hiddenfields)) {
|
||||
print '<td class="right">'.($plannedworkload ?convertSecondToTime($plannedworkload) : '').'</td>';
|
||||
print '<td class="right nowraponall">'.($plannedworkload ?convertSecondToTime($plannedworkload) : '').'</td>';
|
||||
}
|
||||
if (!in_array('declaredprogress', $hiddenfields)) {
|
||||
$declaredprogressworkload = $objp->declared_progess_workload;
|
||||
$total_declaredprogressworkload += $declaredprogressworkload;
|
||||
print '<td class="right">';
|
||||
print '<td class="right nowraponall">';
|
||||
//print $objp->planned_workload.'-'.$objp->declared_progess_workload."<br>";
|
||||
print ($plannedworkload ?round(100 * $declaredprogressworkload / $plannedworkload, 0).'%' : '');
|
||||
print '</td>';
|
||||
|
||||
@ -146,7 +146,7 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
|
||||
}
|
||||
$ivseed = dolGetRandomBytes($ivlen);
|
||||
|
||||
$newchain = openssl_encrypt($chain, $ciphering, $key, null, $ivseed);
|
||||
$newchain = openssl_encrypt($chain, $ciphering, $key, 0, $ivseed);
|
||||
return 'dolcrypt:'.$ciphering.':'.$ivseed.':'.$newchain;
|
||||
} else {
|
||||
return $chain;
|
||||
@ -180,9 +180,9 @@ function dolDecrypt($chain, $key = '')
|
||||
if (function_exists('openssl_decrypt')) {
|
||||
$tmpexplode = explode(':', $reg[2]);
|
||||
if (!empty($tmpexplode[1]) && is_string($tmpexplode[0])) {
|
||||
$newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, null, $tmpexplode[0]);
|
||||
$newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, 0, $tmpexplode[0]);
|
||||
} else {
|
||||
$newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, null, null);
|
||||
$newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, 0, null);
|
||||
}
|
||||
} else {
|
||||
$newchain = 'Error function openssl_decrypt() not available';
|
||||
|
||||
@ -2409,6 +2409,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
|
||||
$newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read'));
|
||||
$newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read'));
|
||||
$newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read'));
|
||||
$newmenu->add("/adherents/list.php?leftmenu=members&statut=-2", $langs->trans("MenuMembersExcluded"), 2, $user->hasRight('adherent', 'read'));
|
||||
$newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read'));
|
||||
|
||||
$newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export'));
|
||||
|
||||
@ -1881,7 +1881,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj2 = $this->db->fetch_object($resqlseladmin);
|
||||
dol_syslog(get_class($this)."::insert_permissions Add permission id '.$r_id.' to user id=".$obj2->rowid);
|
||||
dol_syslog(get_class($this)."::insert_permissions Add permission id ".$r_id." to user id=".$obj2->rowid);
|
||||
|
||||
$tmpuser = new User($this->db);
|
||||
$result = $tmpuser->fetch($obj2->rowid);
|
||||
@ -1968,13 +1968,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
$menu->menu_handler = 'all';
|
||||
|
||||
//$menu->module=strtolower($this->name); TODO When right_class will be same than module name
|
||||
$menu->module = empty($this->rights_class) ?strtolower($this->name) : $this->rights_class;
|
||||
$menu->module = (empty($this->rights_class) ? strtolower($this->name) : $this->rights_class);
|
||||
|
||||
if (!$this->menu[$key]['fk_menu']) {
|
||||
$menu->fk_menu = 0;
|
||||
} else {
|
||||
$foundparent = 0;
|
||||
$fk_parent = $this->menu[$key]['fk_menu'];
|
||||
$reg = array();
|
||||
if (preg_match('/^r=/', $fk_parent)) { // old deprecated method
|
||||
$fk_parent = str_replace('r=', '', $fk_parent);
|
||||
if (isset($this->menu[$fk_parent]['rowid'])) {
|
||||
|
||||
@ -152,37 +152,20 @@ class modApi extends DolibarrModules
|
||||
$this->menu = array(); // List of menus to add
|
||||
$r = 0;
|
||||
|
||||
// Add here entries to declare new menus
|
||||
//
|
||||
// Example to declare a new Top Menu entry and its Left menu entry:
|
||||
// $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu
|
||||
// 'type'=>'top', // This is a Top menu entry
|
||||
// 'titre'=>'Api top menu',
|
||||
// 'mainmenu'=>'api',
|
||||
// 'leftmenu'=>'api',
|
||||
// 'url'=>'/api/pagetop.php',
|
||||
// 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'enabled'=>'$conf->api->enabled', // Define condition to show or hide menu entry. Use '$conf->api->enabled' if entry must be visible if module is enabled.
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->api->level1->level2' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
//
|
||||
// Example to declare a Left Menu entry into an existing Top menu entry:
|
||||
// $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
// 'type'=>'left', // This is a Left menu entry
|
||||
// 'titre'=>'Api left menu',
|
||||
// 'mainmenu'=>'xxx',
|
||||
// 'leftmenu'=>'api',
|
||||
// 'url'=>'/api/pagelevel2.php',
|
||||
// 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'enabled'=>'$conf->api->enabled', // Define condition to show or hide menu entry. Use '$conf->api->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->api->level1->level2' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=tools',
|
||||
'type'=>'left',
|
||||
'titre'=>'ApiExplorer',
|
||||
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
|
||||
'mainmenu'=>'tools',
|
||||
'leftmenu'=>'devtools_api',
|
||||
'url'=>'/api/index.php/explorer',
|
||||
'langs'=>'modulebuilder',
|
||||
'position'=>100,
|
||||
'perms'=>'1',
|
||||
//'enabled'=>'isModEnabled("api") && preg_match(\'/^(devtools)/\',$leftmenu)',
|
||||
'enabled'=>'isModEnabled("api")',
|
||||
'target'=>'_apiexplorer',
|
||||
'user'=>0);
|
||||
|
||||
|
||||
// Exports
|
||||
|
||||
@ -102,16 +102,18 @@ class modModuleBuilder extends DolibarrModules
|
||||
//------------------
|
||||
$this->menu = array();
|
||||
|
||||
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools',
|
||||
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=tools',
|
||||
'type'=>'left',
|
||||
'titre'=>'ModuleBuilder',
|
||||
'mainmenu'=>'home',
|
||||
'leftmenu'=>'admintools_modulebuilder',
|
||||
'url'=>'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools',
|
||||
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
|
||||
'mainmenu'=>'tools',
|
||||
'leftmenu'=>'devtools_modulebuilder',
|
||||
'url'=>'/modulebuilder/index.php?mainmenu=tools&leftmenu=devtools',
|
||||
'langs'=>'modulebuilder',
|
||||
'position'=>100,
|
||||
'perms'=>'1',
|
||||
'enabled'=>'$conf->modulebuilder->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu) && ($user->admin || $conf->global->MODULEBUILDER_FOREVERYONE)',
|
||||
'perms'=>'$user->hasRight("modulebuilder", "run")',
|
||||
//'enabled'=>'isModEnabled("modulebuilder") && preg_match(\'/^(devtools|all)/\',$leftmenu)',
|
||||
'enabled'=>'isModEnabled("modulebuilder")',
|
||||
'target'=>'_modulebuilder',
|
||||
'user'=>0);
|
||||
}
|
||||
|
||||
@ -78,6 +78,23 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($massaction == 'preupdateprice' && isModEnabled('category')) {
|
||||
$formquestion = array();
|
||||
|
||||
$valuefield = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 150px">';
|
||||
$valuefield .= '<input type="number" name="pricerate" id="pricerate" min="-100" value="0" style="width: 100px; text-align: right; margin-right: 10px" />%';
|
||||
$valuefield .= '</div>';
|
||||
|
||||
$formquestion[] = array(
|
||||
'type' => 'other',
|
||||
'name' => 'pricerate',
|
||||
'label' => $langs->trans("Rate"),
|
||||
'value' => $valuefield
|
||||
);
|
||||
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $langs->trans("ConfirmUpdatePriceQuestion", count($toselect)), "updateprice", $formquestion, 1, 0, 200, 500, 1);
|
||||
}
|
||||
|
||||
if ($massaction == 'presetsupervisor') {
|
||||
$formquestion = array();
|
||||
|
||||
@ -96,6 +113,7 @@ if ($massaction == 'presetsupervisor') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmSetSupervisor"), $langs->trans("ConfirmSetSupervisorQuestion", count($toselect)), "setsupervisor", $formquestion, 1, 0, 200, 500, 1);
|
||||
}
|
||||
|
||||
|
||||
if ($massaction == 'presend') {
|
||||
$langs->load("mails");
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ if ($nolinesbefore) {
|
||||
<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||
<td class="linecolnum center"></td>
|
||||
<?php } ?>
|
||||
<td class="linecoldescription minwidth500imp">
|
||||
<td class="linecoldescription minwidth400imp">
|
||||
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span>
|
||||
</td>
|
||||
<?php
|
||||
@ -176,8 +176,7 @@ if ($nolinesbefore) {
|
||||
}
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="nobottom linecoldescription minwidth500imp">
|
||||
|
||||
<td class="nobottom linecoldescription minwidth400imp">
|
||||
<?php
|
||||
$freelines = false;
|
||||
if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) {
|
||||
@ -258,9 +257,11 @@ if ($nolinesbefore) {
|
||||
}
|
||||
if (empty($senderissupplier)) {
|
||||
$statustoshow = 1;
|
||||
$statuswarehouse = 'warehouseopen,warehouseinternal';
|
||||
if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) $statuswarehouse = 'warehouseopen';
|
||||
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, $statuswarehouse, GETPOST('combinations', 'array'));
|
||||
} else {
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
|
||||
}
|
||||
|
||||
@ -103,7 +103,23 @@ class InterfaceWebhookTriggers extends DolibarrTriggers
|
||||
foreach ($target_url as $key => $tmpobject) {
|
||||
$actionarray = explode(",", $tmpobject->trigger_codes);
|
||||
if (is_array($actionarray) && in_array($action, $actionarray)) {
|
||||
$jsonstr = '{"triggercode":'.json_encode($action).',"object":'.json_encode($object).'}';
|
||||
// Build the answer object
|
||||
$resobject = new stdClass();
|
||||
$resobject->triggercode = $action;
|
||||
$resobject->object = dol_clone($object, 2);
|
||||
|
||||
if (property_exists($resobject->object, 'fields')) {
|
||||
unset($resobject->object->fields);
|
||||
}
|
||||
if (property_exists($resobject->object, 'error')) {
|
||||
unset($resobject->object->error);
|
||||
}
|
||||
if (property_exists($resobject->object, 'errors')) {
|
||||
unset($resobject->object->errors);
|
||||
}
|
||||
|
||||
$jsonstr = json_encode($resobject);
|
||||
|
||||
$response = getURLContent($tmpobject->url, 'POST', $jsonstr, 1, array(), array('http', 'https'), 0, -1);
|
||||
if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) {
|
||||
$nbPosts ++;
|
||||
|
||||
@ -493,7 +493,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
if (!empty($object->datestart)) {
|
||||
print $form->selectDate($object->datestart, 'datestart', 1, 1, '', "cronform");
|
||||
} else {
|
||||
print $form->selectDate(-1, 'datestart', 1, 1, '', "cronform");
|
||||
print $form->selectDate(-1, 'datestart', 1, 1, 1, "cronform");
|
||||
}
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
@ -505,7 +505,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
if (!empty($object->dateend)) {
|
||||
print $form->selectDate($object->dateend, 'dateend', 1, 1, '', "cronform");
|
||||
} else {
|
||||
print $form->selectDate(-1, 'dateend', 1, 1, '', "cronform");
|
||||
print $form->selectDate(-1, 'dateend', 1, 1, 1, "cronform");
|
||||
}
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
@ -518,7 +518,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
if (!empty($object->priority)) {
|
||||
$priority = $object->priority;
|
||||
}
|
||||
print "<td><input type=\"text\" size=\"2\" name=\"priority\" value=\"".$priority."\" /> ";
|
||||
print '<td><input type="text" class="width50" name="priority" value="'.$priority.'" /> ';
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
@ -530,7 +530,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
$maxrun = $object->maxrun;
|
||||
}
|
||||
print $langs->trans('CronMaxRun')."</td>";
|
||||
print "<td><input type=\"text\" size=\"2\" name=\"maxrun\" value=\"".$maxrun."\" /> ";
|
||||
print '<td><input type="text" class="width50" name="maxrun" value="'.$maxrun.'" /> ';
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
@ -538,12 +538,12 @@ if (($action == "create") || ($action == "edit")) {
|
||||
|
||||
print '<tr><td class="fieldrequired">';
|
||||
print $langs->trans('CronDtNextLaunch');
|
||||
print ' ('.$langs->trans('CronFrom').')';
|
||||
//print ' ('.$langs->trans('CronFrom').')';
|
||||
print "</td><td>";
|
||||
if (!empty($object->datenextrun)) {
|
||||
print $form->selectDate($object->datenextrun, 'datenextrun', 1, 1, '', "cronform");
|
||||
} else {
|
||||
print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform");
|
||||
print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform", 1, 1);
|
||||
}
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
@ -774,7 +774,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CronLastOutput')."</td><td>";
|
||||
print nl2br($object->lastoutput);
|
||||
print '<span class="small">'.nl2br($object->lastoutput).'</span>';
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
@ -787,7 +787,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
print "\n\n<div class=\"tabsAction\">\n";
|
||||
print "\n\n".'<div class="tabsAction">'."\n";
|
||||
if (!$user->rights->cron->create) {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("Edit").'</a>';
|
||||
} else {
|
||||
|
||||
@ -420,7 +420,7 @@ if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) {
|
||||
$text .= $langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS);
|
||||
}
|
||||
print info_admin($text);
|
||||
print '<br>';
|
||||
//print '<br>';
|
||||
|
||||
//$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = '';
|
||||
@ -447,7 +447,7 @@ print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Scheduled")), $search_status, 1);
|
||||
print '</td><td class="liste_titre right">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
@ -460,18 +460,18 @@ print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "t.rowid", "", $param, '',
|
||||
print_liste_field_titre("CronLabel", $_SERVER["PHP_SELF"], "t.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Prority", $_SERVER["PHP_SELF"], "t.priority", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronModule", $_SERVER["PHP_SELF"], "t.module_name", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortorder, 'tdoverflowmax100 ');
|
||||
print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("CronDtEnd", $_SERVER["PHP_SELF"], "t.dateend", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, '', $sortfield, $sortorder, 'right tdoverflowmax50');
|
||||
print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("CronLastOutput", $_SERVER["PHP_SELF"], "t.lastoutput", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronDtNextLaunch", $_SERVER["PHP_SELF"], "t.datenextrun", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "t.status,t.priority", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
print_liste_field_titre("CronDtNextLaunch", $_SERVER["PHP_SELF"], "t.datenextrun", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "t.status,t.priority", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -560,19 +560,20 @@ if ($num > 0) {
|
||||
print $form->textwithpicto($text, $texttoshow, 1);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
$s = '';
|
||||
if ($obj->unitfrequency == "60") {
|
||||
print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Minutes');
|
||||
}
|
||||
if ($obj->unitfrequency == "3600") {
|
||||
print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Hours');
|
||||
}
|
||||
if ($obj->unitfrequency == "86400") {
|
||||
print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Days');
|
||||
}
|
||||
if ($obj->unitfrequency == "604800") {
|
||||
print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Weeks');
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Minutes') : $langs->trans('Minute'));
|
||||
} elseif ($obj->unitfrequency == "3600") {
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Hours') : $langs->trans('Hour'));
|
||||
} elseif ($obj->unitfrequency == "86400") {
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Days') : $langs->trans('Day'));
|
||||
} elseif ($obj->unitfrequency == "604800") {
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Weeks') : $langs->trans('Week'));
|
||||
} elseif ($obj->unitfrequency == "2678400") {
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Months') : $langs->trans('Month'));
|
||||
}
|
||||
print '<td class="tdoverflowmax125" title="'.$s.'">';
|
||||
print $s;
|
||||
print '</td>';
|
||||
|
||||
/*
|
||||
|
||||
@ -41,7 +41,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -54,7 +54,7 @@ if ($user->socid) {
|
||||
}
|
||||
$result = restrictedArea($user, 'expensereport', $id, '');
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -43,7 +43,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -253,7 +253,7 @@ if (empty($dolibarr_main_data_root)) {
|
||||
// Define some constants
|
||||
define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir (defined only for some code that want to be compatible with old versions without this parameter)
|
||||
define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents)
|
||||
// Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT.
|
||||
// Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT when root is not directly the main domain.
|
||||
// Note: autodetect works only in case 1, 2, 3 and 4 of phpunit test CoreTest.php. For case 5, 6, only setting value into conf.php will works.
|
||||
$tmp = '';
|
||||
$found = 0;
|
||||
@ -283,7 +283,8 @@ foreach ($paths as $tmppath) { // We check to find (B+start of C)=A
|
||||
}
|
||||
//print "found=".$found." dolibarr_main_url_root=".$dolibarr_main_url_root."\n";
|
||||
if (!$found) {
|
||||
$tmp = $dolibarr_main_url_root; // If autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT).
|
||||
// There is no subdir that compose the main url root or autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT).
|
||||
$tmp = $dolibarr_main_url_root;
|
||||
} else {
|
||||
$tmp = 'http'.(((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') && (empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] != 443)) ? '' : 's').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == 80 || $_SERVER["SERVER_PORT"] == 443) ? '' : ':'.$_SERVER["SERVER_PORT"]).($tmp3 ? (preg_match('/^\//', $tmp3) ? '' : '/').$tmp3 : '');
|
||||
}
|
||||
|
||||
@ -848,7 +848,7 @@ if ($object->id > 0) {
|
||||
if ($object->status == 1) {
|
||||
print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id, '');
|
||||
} else {
|
||||
print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposalGR'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
|
||||
print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposal'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -865,7 +865,7 @@ if ($object->id > 0) {
|
||||
if (!empty($orders2invoice) && $orders2invoice > 0) {
|
||||
if ($object->status == 1) {
|
||||
// Company is open
|
||||
print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisSupplierGR'), 'default', DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1', '');
|
||||
print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisSupplier'), 'default', DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1', '');
|
||||
} else {
|
||||
print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
|
||||
}
|
||||
|
||||
@ -1484,7 +1484,7 @@ if ($num > 0) {
|
||||
|
||||
// Third party
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -1493,7 +1493,7 @@ if ($num > 0) {
|
||||
}
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $thirdparty->name_alias;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -1550,8 +1550,9 @@ if ($num > 0) {
|
||||
|
||||
// Payment condition
|
||||
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1);
|
||||
$s = $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1, '', -1, -1, 1);
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).'">';
|
||||
print dol_escape_htmltag($s);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -1559,8 +1560,9 @@ if ($num > 0) {
|
||||
}
|
||||
// Payment mode
|
||||
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
|
||||
$s = $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1, 0, '', 1);
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).'">';
|
||||
print dol_escape_htmltag($s);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -1639,7 +1641,7 @@ if ($num > 0) {
|
||||
|
||||
// Author
|
||||
if (!empty($arrayfields['u.login']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if ($userstatic->id) {
|
||||
print $userstatic->getLoginUrl(-1);
|
||||
} else {
|
||||
|
||||
@ -211,6 +211,9 @@ ALTER TABLE llx_projet ADD COLUMN location varchar(255);
|
||||
|
||||
ALTER TABLE llx_c_action_trigger MODIFY COLUMN code varchar(128);
|
||||
|
||||
ALTER TABLE llx_overwrite_trans DROP INDEX uk_overwrite_trans;
|
||||
ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(entity, lang, transkey);
|
||||
|
||||
--
|
||||
-- List of all managed triggered events (used for trigger agenda automatic events and for notification)
|
||||
--
|
||||
@ -368,3 +371,6 @@ ALTER TABLE llx_prelevement_facture_demande RENAME TO llx_prelevement_demande;
|
||||
|
||||
ALTER TABLE llx_prelevement ADD COLUMN fk_salary INTEGER NULL AFTER fk_facture_fourn;
|
||||
ALTER TABLE llx_prelevement_demande ADD COLUMN fk_salary INTEGER NULL AFTER fk_facture_fourn;
|
||||
|
||||
|
||||
ALTER TABLE llx_user ADD COLUMN birth_place varchar(64);
|
||||
|
||||
@ -17,5 +17,4 @@
|
||||
-- ===========================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey);
|
||||
|
||||
ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(entity, lang, transkey);
|
||||
|
||||
@ -50,6 +50,7 @@ create table llx_user
|
||||
fk_state integer DEFAULT 0,
|
||||
fk_country integer DEFAULT 0,
|
||||
birth date, -- birthday
|
||||
birth_place varchar(64), -- birth place (town)
|
||||
job varchar(128),
|
||||
office_phone varchar(20),
|
||||
office_fax varchar(20),
|
||||
|
||||
@ -222,9 +222,9 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
|
||||
print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."<br>";
|
||||
$success = 1;
|
||||
} else {
|
||||
if ($newuser->error == 'ErrorLoginAlreadyExists') {
|
||||
if ($result == -6) { //login or email already exists
|
||||
dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
|
||||
print '<br><div class="warning">'.$langs->trans("AdminLoginAlreadyExists", $login)."</div><br>";
|
||||
print '<br><div class="warning">'.$newuser->error."</div><br>";
|
||||
$success = 1;
|
||||
} else {
|
||||
dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
|
||||
@ -450,7 +450,7 @@ if ($action == "set") {
|
||||
$morehtml .= '</a></div>';
|
||||
}
|
||||
} else {
|
||||
dol_print_error('', 'step5.php: unknown choice of action');
|
||||
dol_print_error('', 'step5.php: unknown choice of action='.$action.' in create lock file seaction');
|
||||
}
|
||||
|
||||
// Clear cache files
|
||||
|
||||
@ -2333,4 +2333,6 @@ MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents f
|
||||
WarningDisabled=Warning disabled
|
||||
LimitsAndMitigation=Access limits and mitigation
|
||||
DesktopsOnly=Desktops only
|
||||
DesktopsAndSmartphones=Desktops et smartphones
|
||||
DesktopsAndSmartphones=Desktops et smartphones
|
||||
AllowOnlineSign=Allow online signing
|
||||
AllowExternalDownload=Allow external download (without login, using a shared link)
|
||||
@ -88,7 +88,7 @@ DeleteFromCat=Remove from tags/category
|
||||
ExtraFieldsCategories=Complementary attributes
|
||||
CategoriesSetup=Tags/categories setup
|
||||
CategorieRecursiv=Link with parent tag/category automatically
|
||||
CategorieRecursivHelp=If option is on, when you add a product into a subcategory, product will also be added into the parent category.
|
||||
CategorieRecursivHelp=If option is on, when you add an object into a subcategory, the object will also be added into the parent categories.
|
||||
AddProductServiceIntoCategory=Add the following product/service
|
||||
AddCustomerIntoCategory=Assign category to customer
|
||||
AddSupplierIntoCategory=Assign category to supplier
|
||||
|
||||
@ -101,8 +101,6 @@ TypeContact_contrat_external_BILLING=Billing customer contact
|
||||
TypeContact_contrat_external_CUSTOMER=Follow-up customer contact
|
||||
TypeContact_contrat_external_SALESREPSIGN=Signing contract customer contact
|
||||
HideClosedServiceByDefault=Hide closed services by default
|
||||
AllowOnlineSign=Allow online signing
|
||||
AllowExternalDownload=Allow external download
|
||||
ShowClosedServices=Show Closed Services
|
||||
HideClosedServices=Hide Closed Services
|
||||
UserStartingService=User starting service
|
||||
|
||||
@ -26,7 +26,7 @@ CronCommand=Command
|
||||
CronList=Scheduled jobs
|
||||
CronDelete=Delete scheduled jobs
|
||||
CronConfirmDelete=Are you sure you want to delete these scheduled jobs?
|
||||
CronExecute=Launch scheduled job
|
||||
CronExecute=Launch now
|
||||
CronConfirmExecute=Are you sure you want to execute these scheduled jobs now?
|
||||
CronInfo=Scheduled job module allows to schedule jobs to execute them automatically. Jobs can also be started manually.
|
||||
CronTask=Job
|
||||
@ -58,7 +58,7 @@ CronNote=Comment
|
||||
CronFieldMandatory=Fields %s is mandatory
|
||||
CronErrEndDateStartDt=End date cannot be before start date
|
||||
StatusAtInstall=Status at module installation
|
||||
CronStatusActiveBtn=Schedule
|
||||
CronStatusActiveBtn=Enable scheduling
|
||||
CronStatusInactiveBtn=Disable
|
||||
CronTaskInactive=This job is disabled (not scheduled)
|
||||
CronId=Id
|
||||
|
||||
@ -68,6 +68,4 @@ ConfirmReopenIntervention=Are you sure you want to open back the intervention <b
|
||||
GenerateInter=Generate intervention
|
||||
FichinterNoContractLinked=Intervention %s has been created without a linked contract.
|
||||
ErrorFicheinterCompanyDoesNotExist=Company does not exist. Intervention has not been created.
|
||||
NextDateToIntervention=Date for next intervention generation
|
||||
AllowOnlineSign=Allow online signing
|
||||
AllowExternalDownload=Allow external download
|
||||
NextDateToIntervention=Date for next intervention generation
|
||||
@ -1150,9 +1150,12 @@ SetSupervisor=Set Supervisor
|
||||
CreateExternalUser=Create external user
|
||||
ConfirmAffectTag=Bulk Tag Affect
|
||||
ConfirmSetSupervisor=Bulk Supervisor Set
|
||||
ConfirmUpdatePrice=Choose a increase/decrease price rate
|
||||
ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)?
|
||||
ConfirmSetSupervisorQuestion=Are you sure you want to set supervisor to the %s selected record(s)?
|
||||
ConfirmUpdatePriceQuestion=Are you sure you want to update the price of the %s selected record(s)?
|
||||
CategTypeNotFound=No tag type found for type of records
|
||||
Rate=Rate
|
||||
SupervisorNotFound=Supervisor not found
|
||||
CopiedToClipboard=Copied to clipboard
|
||||
InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration.
|
||||
|
||||
@ -35,8 +35,8 @@ DateSubscription=Date of membership
|
||||
DateEndSubscription=End date of membership
|
||||
EndSubscription=End of membership
|
||||
SubscriptionId=Contribution ID
|
||||
WithoutSubscription=Without contribution
|
||||
WaitingSubscription=Waiting contribution
|
||||
WithoutSubscription=Without membership
|
||||
WaitingSubscription=Membership pending
|
||||
MemberId=Member Id
|
||||
MemberRef=Member Ref
|
||||
NewMember=New member
|
||||
|
||||
@ -86,7 +86,7 @@ IsAMeasure=Is a measure
|
||||
DirScanned=Directory scanned
|
||||
NoTrigger=No trigger
|
||||
NoWidget=No widget
|
||||
GoToApiExplorer=API explorer
|
||||
ApiExplorer=API explorer
|
||||
ListOfMenusEntries=List of menu entries
|
||||
ListOfDictionariesEntries=List of dictionaries entries
|
||||
ListOfPermissionsDefined=List of defined permissions
|
||||
|
||||
@ -20,6 +20,7 @@ ModulePartnershipName=Partnership management
|
||||
PartnershipDescription=Module Partnership management
|
||||
PartnershipDescriptionLong= Module Partnership management
|
||||
Partnership=Partnership
|
||||
Partnerships=Partnerships
|
||||
AddPartnership=Add partnership
|
||||
CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions
|
||||
PartnershipCheckBacklink=Partnership: Check referring backlink
|
||||
@ -49,8 +50,8 @@ PublicFormRegistrationPartnerDesc=Dolibarr can provide you a public URL/website
|
||||
# Object
|
||||
#
|
||||
DeletePartnership=Delete a partnership
|
||||
PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party
|
||||
PartnershipDedicatedToThisMember=Partnership dedicated to this member
|
||||
PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party
|
||||
PartnershipDedicatedToThisMember=Partnership dedicated to this member
|
||||
DatePartnershipStart=Start date
|
||||
DatePartnershipEnd=End date
|
||||
ReasonDecline=Decline reason
|
||||
|
||||
@ -416,6 +416,7 @@ ProductsMergeSuccess=Products have been merged
|
||||
ErrorsProductsMerge=Errors in products merge
|
||||
SwitchOnSaleStatus=Switch on sale status
|
||||
SwitchOnPurchaseStatus=Switch on purchase status
|
||||
UpdatePrice=Increase/decrease customer price
|
||||
StockMouvementExtraFields= Extra Fields (stock mouvement)
|
||||
InventoryExtraFields= Extra Fields (inventory)
|
||||
ScanOrTypeOrCopyPasteYourBarCodes=Scan or type or copy/paste your barcodes
|
||||
|
||||
@ -3,3 +3,4 @@ OperationParamDesc=Define the rules to use to extract or set values.<br>Example
|
||||
EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it.<br>For example, if you want to create a thirdparty with a name extracted from a string 'Name: name to find' present into the body, use the sender email as email, you can set the parameter field like this:<br>'email=HEADER:^From:(.*);name=EXTRACT:BODY:Name:\\s([^\\s]*);client=SET:2;'<br>
|
||||
IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax
|
||||
IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax
|
||||
AllowExternalDownload=Allow external download
|
||||
|
||||
@ -2330,3 +2330,4 @@ HelpCssOnViewDesc=Le CSS utilisé lors de l'affichage du champ.
|
||||
HelpCssOnListDesc=Le CSS utilisé lorsque le champ est à l'intérieur du tableau d'une liste. <br> Exemple : "tdoverflowmax200"
|
||||
RECEPTION_PDF_HIDE_ORDERED=Masquer la quantité commandée sur les documents générés pour les réceptions
|
||||
MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Afficher le prix sur les documents générés pour les réceptions
|
||||
AllowExternalDownload=Autoriser le téléchargement externe
|
||||
|
||||
@ -102,7 +102,6 @@ TypeContact_contrat_external_CUSTOMER=Contact client suivi contrat
|
||||
TypeContact_contrat_external_SALESREPSIGN=Contact client signataire contrat
|
||||
HideClosedServiceByDefault=Masquer les services fermés par défaut
|
||||
AllowOnlineSign=Autoriser la signature en ligne
|
||||
AllowExternalDownload=Autoriser le téléchargement externe
|
||||
ShowClosedServices=Afficher les services fermés
|
||||
HideClosedServices=Masquer les services fermés
|
||||
UserStartingService=Utilisateur démarrant le service
|
||||
|
||||
@ -566,7 +566,7 @@ None=Aucun
|
||||
NoneF=Aucune
|
||||
NoneOrSeveral=Aucun ou plusieurs
|
||||
Late=Retard
|
||||
LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes
|
||||
LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes
|
||||
NoItemLate=Aucun élément en retard
|
||||
Photo=Photo
|
||||
Photos=Photos
|
||||
@ -1150,9 +1150,12 @@ SetSupervisor=Choisir un superviseur
|
||||
CreateExternalUser=Créer utilisateur externe
|
||||
ConfirmAffectTag=Affecter les tags en masse
|
||||
ConfirmSetSupervisor=Choisir un superviseur en masse
|
||||
ConfirmUpdatePrice=Choisir un pourcentage de hausse/baisse des prix
|
||||
ConfirmAffectTagQuestion=Êtes-vous sur de vouloir affecter ces catégories aux %s lignes sélectionnées ?
|
||||
ConfirmSetSupervisorQuestion=Êtes-vous sur de vouloir affecter ce superviseur aux %s lignes sélectionnées ?
|
||||
ConfirmUpdatePriceQuestion=Êtes-vous sur de vouloir mettre à jour les prix des %s lignes sélectionnées ?
|
||||
CategTypeNotFound=Aucun type de tag trouvé pour ce type d'enregistrements
|
||||
Rate=Taux
|
||||
SupervisorNotFound=Supervisuer non trouvé
|
||||
CopiedToClipboard=Copié dans le presse-papier
|
||||
InformationOnLinkToContract=Ce montant n’est que le total de toutes les lignes du contrat. Aucune notion de temps n’est prise en considération.
|
||||
|
||||
@ -20,6 +20,7 @@ ModulePartnershipName=Gestion des partenariats
|
||||
PartnershipDescription=Module de gestion des partenariats
|
||||
PartnershipDescriptionLong= Module de gestion des partenariats
|
||||
Partnership=Partenariat
|
||||
Partnerships=Partenariats
|
||||
AddPartnership=Ajouter un partenariat
|
||||
CancelPartnershipForExpiredMembers=Partenariat : annuler le partenariat des adhérents dont les cotisations ont expirés
|
||||
PartnershipCheckBacklink=Partenariat : Vérifiez le backlink référent
|
||||
|
||||
@ -416,6 +416,7 @@ ProductsMergeSuccess=Produits fusionnés
|
||||
ErrorsProductsMerge=Erreur lors de la fusion des produits
|
||||
SwitchOnSaleStatus=Basculer le statut En vente
|
||||
SwitchOnPurchaseStatus=Basculer le statut En achat
|
||||
UpdatePrice=Augmenter/baisser le prix de vente
|
||||
StockMouvementExtraFields= Champs supplémentaires (mouvement de stock)
|
||||
InventoryExtraFields= Attributs supplémentaires (inventaire)
|
||||
ScanOrTypeOrCopyPasteYourBarCodes=Scannez ou tapez ou copiez/collez vos codes-barres
|
||||
|
||||
@ -84,7 +84,7 @@ $idmodule= GETPOST('idmodule', 'alpha');
|
||||
if (!isModEnabled('modulebuilder')) {
|
||||
accessforbidden('Module ModuleBuilder not enabled');
|
||||
}
|
||||
if (!$user->admin && empty($conf->global->MODULEBUILDER_FOREVERYONE)) {
|
||||
if (!$user->hasRight("modulebuilder", "run")) {
|
||||
accessforbidden('ModuleBuilderNotAllowed');
|
||||
}
|
||||
|
||||
@ -2836,9 +2836,9 @@ if ($module == 'initmodule') {
|
||||
print '<a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||
print ' ';
|
||||
if (empty($conf->global->$const_name)) { // If module is not activated
|
||||
print '<a href="#" class="classfortooltip" target="apiexplorer" title="'.$langs->trans("ModuleMustBeEnabled", $module).'"><strike>'.$langs->trans("GoToApiExplorer").'</strike></a>';
|
||||
print '<a href="#" class="classfortooltip" target="apiexplorer" title="'.$langs->trans("ModuleMustBeEnabled", $module).'"><strike>'.$langs->trans("ApiExplorer").'</strike></a>';
|
||||
} else {
|
||||
print '<a href="'.DOL_URL_ROOT.'/api/index.php/explorer/" target="apiexplorer">'.$langs->trans("GoToApiExplorer").'</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/api/index.php/explorer/" target="apiexplorer">'.$langs->trans("ApiExplorer").'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initapi&token='.newToken().'&format=php&file='.urlencode($pathtoapi).'">'.img_picto('Generate', 'generate', 'class="paddingleft"').'</a>';
|
||||
|
||||
@ -87,7 +87,7 @@ require_once __DIR__.'/class/myobject.class.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mymodule@mymodule", "other"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
|
||||
@ -49,7 +49,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'moc
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
$TBomLineId = GETPOST('bomlineid', 'array');
|
||||
//$lineid = GETPOST('lineid', 'int');
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
$socid = GETPOST("socid", 'int');
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new Mo($db);
|
||||
@ -678,7 +679,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=mo', 'clone', $permissiontoadd);
|
||||
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : "").'&action=clone&object=mo', 'clone', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Cancel - Reopen
|
||||
@ -725,7 +726,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$filedir = $conf->mrp->dir_output.'/'.$objref;
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed = $user->rights->mrp->read; // If you can read, you can build the PDF to read content
|
||||
$delallowed = $user->rights->mrp->create; // If you can create/edit, you can remove a file on card
|
||||
$delallowed = $user->hasRight("mrp", "creer"); // If you can create/edit, you can remove a file on card
|
||||
print $formfile->showdocuments('mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $mysoc->default_lang);
|
||||
|
||||
// Show links to link elements
|
||||
|
||||
@ -47,7 +47,8 @@ $confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mostockmovement'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
//$lineid = GETPOST('lineid', 'int');
|
||||
$massaction = GETPOST('massaction', 'aZ09');
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
$msid = GETPOST('msid', 'int');
|
||||
$year = GETPOST("year", 'int');
|
||||
|
||||
@ -28,7 +28,9 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php';
|
||||
|
||||
// for other modules
|
||||
@ -49,7 +51,8 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '
|
||||
$mode = GETPOST('mode', 'aZ');
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$memberid = GETPOST('rowid', 'int');
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@ -68,7 +71,13 @@ $object = new Partnership($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$adherent = new Adherent($db);
|
||||
$diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('partnershiplist')); // Note that conf->hooks_modules contains array
|
||||
if ($socid > 0) {
|
||||
$hookmanager->initHooks(array('thirdpartypartnership'));
|
||||
} elseif ($memberid > 0) {
|
||||
$hookmanager->initHooks(array('memberpartnership'));
|
||||
} else {
|
||||
$hookmanager->initHooks(array('partnershiplist')); // Note that conf->hooks_modules contains array
|
||||
}
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
@ -144,7 +153,6 @@ $permissiontodelete = $user->rights->partnership->delete;
|
||||
if (empty($conf->partnership->enabled)) {
|
||||
accessforbidden('Module not enabled');
|
||||
}
|
||||
$socid = 0;
|
||||
if ($user->socid > 0) { // Protection if external user
|
||||
//$socid = $user->socid;
|
||||
accessforbidden();
|
||||
@ -325,9 +333,19 @@ if ($object->ismultientitymanaged == 1) {
|
||||
} else {
|
||||
$sql .= " WHERE 1 = 1";
|
||||
}
|
||||
if ($managedfor == 'member')
|
||||
$sql .= " AND fk_member > 0";
|
||||
else $sql .= " AND fk_soc > 0";
|
||||
if ($managedfor == 'member') {
|
||||
if ($memberid > 0) {
|
||||
$sql .= " AND t.fk_member = ".((int) $memberid);
|
||||
} else {
|
||||
$sql .= " AND fk_member > 0";
|
||||
}
|
||||
} else {
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND t.fk_soc = ".((int) $socid);
|
||||
} else {
|
||||
$sql .= " AND fk_soc > 0";
|
||||
}
|
||||
}
|
||||
foreach ($search as $key => $val) {
|
||||
if (array_key_exists($key, $object->fields)) {
|
||||
if ($key == 'status' && $search[$key] == -1) {
|
||||
@ -449,6 +467,113 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
|
||||
|
||||
if ($managedfor == "member") {
|
||||
if ($memberid > 0 && $user->hasRight('adherent', 'lire')) {
|
||||
$langs->load("members");
|
||||
|
||||
$adhstat = new Adherent($db);
|
||||
$adht = new AdherentType($db);
|
||||
$result = $adhstat->fetch($memberid);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
$langs->load("mails");
|
||||
}
|
||||
|
||||
$adht->fetch($adhstat->typeid);
|
||||
|
||||
$head = member_prepare_head($adhstat);
|
||||
|
||||
print dol_get_fiche_head($head, 'partnerships', $langs->trans("ThirdParty"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||
}
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$adhstat->getmorphylib().'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$adhstat->company.'</td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$adhstat->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
} elseif ($managedfor == "thirdparty") {
|
||||
if ($socid && $user->hasRight('societe', 'lire')) {
|
||||
$socstat = new Societe($db);
|
||||
$res = $socstat->fetch($socid);
|
||||
if ($res > 0) {
|
||||
$tmpobject = $object;
|
||||
$object = $socstat; // $object must be of type Societe when calling societe_prepare_head
|
||||
$head = societe_prepare_head($socstat);
|
||||
$object = $tmpobject;
|
||||
|
||||
print dol_get_fiche_head($head, 'partnerships', $langs->trans("ThirdParty"), -1, 'company');
|
||||
|
||||
dol_banner_tab($socstat, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Type Prospect/Customer/Supplier
|
||||
print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><td>';
|
||||
print $socstat->getTypeUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Customer code
|
||||
if ($socstat->client && !empty($socstat->code_client)) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('CustomerCode').'</td><td>';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($socstat->code_client));
|
||||
$tmpcheck = $socstat->check_codeclient();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <span class="error">('.$langs->trans("WrongCustomerCode").')</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
// Supplier code
|
||||
if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('SupplierCode').'</td><td>';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($socstat->code_fournisseur));
|
||||
$tmpcheck = $socstat->check_codefournisseur();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <span class="error">('.$langs->trans("WrongSupplierCode").')</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
@ -459,6 +584,12 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
if ($socid) {
|
||||
$param .= '&socid='.urlencode($socid);
|
||||
}
|
||||
if ($memberid) {
|
||||
$param .= '&rowid='.urlencode($memberid);
|
||||
}
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
@ -512,7 +643,11 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
if ($socid) {
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'" >';
|
||||
} elseif ($memberid) {
|
||||
print '<input type="hidden" name="rowid" value="'.$memberid.'" >';
|
||||
}
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/partnership/partnership_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
||||
|
||||
|
||||
@ -403,6 +403,7 @@ class FormProduct
|
||||
|
||||
dol_syslog(get_class($this)."::selectWorkstations $selected, $htmlname, $empty, $disabled, $fk_product, $empty_label, $forcecombo, $morecss", LOG_DEBUG);
|
||||
|
||||
$filterstatus='';
|
||||
$out = '';
|
||||
if (!empty($fk_product) && $fk_product > 0) {
|
||||
$this->cache_workstations = array();
|
||||
|
||||
@ -127,19 +127,23 @@ class Product extends CommonObject
|
||||
public $type = self::TYPE_PRODUCT;
|
||||
|
||||
/**
|
||||
* Selling price
|
||||
* Selling price without tax
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $price; // Price net
|
||||
public $price;
|
||||
|
||||
public $price_formated; // used by takepos/ajax/ajax.php
|
||||
|
||||
/**
|
||||
* Price with tax
|
||||
* Selling price with tax
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $price_ttc;
|
||||
|
||||
public $price_ttc_formated; // used by takepos/ajax/ajax.php
|
||||
|
||||
/**
|
||||
* Minimum price net
|
||||
*
|
||||
|
||||
@ -126,7 +126,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be
|
||||
/*
|
||||
* Number of products and/or services
|
||||
*/
|
||||
if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->produit->lire || $user->rights->service->lire)) {
|
||||
if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
|
||||
$prodser = array();
|
||||
$prodser[0][0] = $prodser[0][1] = $prodser[0][2] = $prodser[0][3] = 0;
|
||||
$prodser[0]['sell'] = 0;
|
||||
@ -284,7 +284,7 @@ print '</div><div class="fichetwothirdright">';
|
||||
/*
|
||||
* Latest modified products
|
||||
*/
|
||||
if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->produit->lire || $user->rights->service->lire)) {
|
||||
if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
|
||||
$max = 15;
|
||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,";
|
||||
$sql .= " p.entity,";
|
||||
|
||||
@ -311,7 +311,6 @@ if (GETPOST('cancel', 'alpha')) {
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
@ -741,11 +740,12 @@ if ($resql) {
|
||||
if ($user->rights->{$rightskey}->creer) {
|
||||
$arrayofmassactions['switchonsalestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnSaleStatus");
|
||||
$arrayofmassactions['switchonpurchasestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnPurchaseStatus");
|
||||
$arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice");
|
||||
}
|
||||
if (isModEnabled('category') && $user->rights->{$rightskey}->creer) {
|
||||
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||
}
|
||||
if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_extrafields'))) {
|
||||
if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_extrafields', 'preupdateprice'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
@ -1380,6 +1380,9 @@ if ($resql) {
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Ref
|
||||
if (!empty($arrayfields['p.rowid']['checked'])) {
|
||||
@ -1908,7 +1911,7 @@ if ($resql) {
|
||||
// Status (to sell)
|
||||
if (!empty($arrayfields['p.tosell']['checked'])) {
|
||||
print '<td class="center nowrap">';
|
||||
if (!empty($conf->use_javascript_ajax) && $user->rights->produit->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
|
||||
} else {
|
||||
print $product_static->LibStatut($obj->tosell, 5, 0);
|
||||
@ -1921,7 +1924,7 @@ if ($resql) {
|
||||
// Status (to buy)
|
||||
if (!empty($arrayfields['p.tobuy']['checked'])) {
|
||||
print '<td class="center nowrap">';
|
||||
if (!empty($conf->use_javascript_ajax) && $user->rights->produit->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
|
||||
} else {
|
||||
print $product_static->LibStatut($obj->tobuy, 5, 1);
|
||||
@ -1943,9 +1946,9 @@ if ($resql) {
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -106,7 +106,7 @@ if ($id > 0) {
|
||||
/* ************************************************************************** */
|
||||
|
||||
print "<div class=\"graph\">\n";
|
||||
$year = strftime("%Y", time());
|
||||
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
|
||||
$file = $conf->stock->dir_temp.'/entrepot-'.$entrepot->id.'-'.($year).'.png';
|
||||
|
||||
|
||||
@ -117,6 +117,12 @@ $error = 0;
|
||||
|
||||
$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire));
|
||||
$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer));
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire');
|
||||
|
||||
if ($object->isService()) {
|
||||
$label = $langs->trans('Service');
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire');
|
||||
}
|
||||
|
||||
if ($object->id > 0) {
|
||||
if ($object->type == $object::TYPE_PRODUCT) {
|
||||
@ -643,17 +649,25 @@ if ($id > 0 || $ref) {
|
||||
$textdesc = $langs->trans("CostPriceDescription");
|
||||
$textdesc .= "<br>".$langs->trans("CostPriceUsage");
|
||||
$text = $form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', '');
|
||||
print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6');
|
||||
if (!$usercancreadprice) {
|
||||
print $form->editfieldkey($text, 'cost_price', '', $object, 0, 'amount:6');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($text, 'cost_price', '', $object, 0, 'amount:6');
|
||||
} else {
|
||||
print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
// AWP
|
||||
print '<tr><td class="titlefield">';
|
||||
print $form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc"));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($object->pmp > 0) {
|
||||
if ($object->pmp > 0 && $usercancreadprice) {
|
||||
print price($object->pmp).' '.$langs->trans("HT");
|
||||
}
|
||||
print '</td>';
|
||||
@ -664,7 +678,7 @@ if ($id > 0 || $ref) {
|
||||
print '<td>';
|
||||
$product_fourn = new ProductFournisseur($db);
|
||||
if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) {
|
||||
if ($product_fourn->product_fourn_price_id > 0) {
|
||||
if ($product_fourn->product_fourn_price_id > 0 && $usercancreadprice) {
|
||||
print $product_fourn->display_price_product_fournisseur();
|
||||
} else {
|
||||
print $langs->trans("NotDefined");
|
||||
@ -675,19 +689,23 @@ if ($id > 0 || $ref) {
|
||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
// Price
|
||||
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td>';
|
||||
if ($object->price_base_type == 'TTC') {
|
||||
print price($object->price_ttc).' '.$langs->trans($object->price_base_type);
|
||||
} else {
|
||||
print price($object->price).' '.$langs->trans($object->price_base_type);
|
||||
if ($usercancreadprice) {
|
||||
if ($object->price_base_type == 'TTC') {
|
||||
print price($object->price_ttc).' '.$langs->trans($object->price_base_type);
|
||||
} else {
|
||||
print price($object->price).' '.$langs->trans($object->price_base_type);
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Price minimum
|
||||
print '<tr><td>'.$langs->trans("MinPrice").'</td><td>';
|
||||
if ($object->price_base_type == 'TTC') {
|
||||
print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type);
|
||||
} else {
|
||||
print price($object->price_min).' '.$langs->trans($object->price_base_type);
|
||||
if ($usercancreadprice) {
|
||||
if ($object->price_base_type == 'TTC') {
|
||||
print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type);
|
||||
} else {
|
||||
print price($object->price_min).' '.$langs->trans($object->price_base_type);
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
@ -1043,7 +1061,11 @@ if (!$variants) {
|
||||
print '<td class="right nowraponall">'.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').'</td>';
|
||||
|
||||
// Value purchase
|
||||
print '<td class="right amount nowraponall">'.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').'</td>';
|
||||
if ($usercancreadprice) {
|
||||
print '<td class="right amount nowraponall">'.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').'</td>';
|
||||
} else {
|
||||
print '<td class="right amount nowraponall"></td>';
|
||||
}
|
||||
|
||||
// Sell price
|
||||
$minsellprice = null; $maxsellprice = null;
|
||||
@ -1060,14 +1082,16 @@ if (!$variants) {
|
||||
}
|
||||
}
|
||||
print '<span class="valignmiddle">';
|
||||
if ($minsellprice != $maxsellprice) {
|
||||
print price(price2num($minsellprice, 'MU'), 1).' - '.price(price2num($maxsellprice, 'MU'), 1);
|
||||
} else {
|
||||
print price(price2num($minsellprice, 'MU'), 1);
|
||||
if ($usercancreadprice) {
|
||||
if ($minsellprice != $maxsellprice) {
|
||||
print price(price2num($minsellprice, 'MU'), 1).' - '.price(price2num($maxsellprice, 'MU'), 1);
|
||||
} else {
|
||||
print price(price2num($minsellprice, 'MU'), 1);
|
||||
}
|
||||
}
|
||||
print '</span>';
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
} else {
|
||||
} elseif ($usercancreadprice) {
|
||||
print price(price2num($object->price, 'MU'), 1);
|
||||
}
|
||||
print '</td>';
|
||||
@ -1076,15 +1100,19 @@ if (!$variants) {
|
||||
print '<td class="right amount nowraponall">';
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
print '<span class="valignmiddle">';
|
||||
if ($minsellprice != $maxsellprice) {
|
||||
print price(price2num($minsellprice * $obj->reel, 'MT'), 1).' - '.price(price2num($maxsellprice * $obj->reel, 'MT'), 1);
|
||||
} else {
|
||||
print price(price2num($minsellprice * $obj->reel, 'MT'), 1);
|
||||
if ($usercancreadprice) {
|
||||
if ($minsellprice != $maxsellprice) {
|
||||
print price(price2num($minsellprice * $obj->reel, 'MT'), 1).' - '.price(price2num($maxsellprice * $obj->reel, 'MT'), 1);
|
||||
} else {
|
||||
print price(price2num($minsellprice * $obj->reel, 'MT'), 1);
|
||||
}
|
||||
}
|
||||
print '</span>';
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
} else {
|
||||
print price(price2num($object->price * $obj->reel, 'MT'), 1);
|
||||
if ($usercancreadprice) {
|
||||
print price(price2num($object->price * $obj->reel, 'MT'), 1);
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
@ -1189,11 +1217,15 @@ if (!$variants) {
|
||||
print '<tr class="liste_total"><td class="right liste_total" colspan="4">'.$langs->trans("Total").':</td>';
|
||||
print '<td class="liste_total right">'.price2num($total, 'MS').'</td>';
|
||||
print '<td class="liste_total right">';
|
||||
print ($totalwithpmp ? price(price2num($totalvalue / $totalwithpmp, 'MU')) : ' '); // This value may have rounding errors
|
||||
if ($usercancreadprice) {
|
||||
print ($totalwithpmp ? price(price2num($totalvalue / $totalwithpmp, 'MU')) : ' '); // This value may have rounding errors
|
||||
}
|
||||
print '</td>';
|
||||
// Value purchase
|
||||
print '<td class="liste_total right">';
|
||||
print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' ';
|
||||
if ($usercancreadprice) {
|
||||
print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' ';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="liste_total right">';
|
||||
if ($num) {
|
||||
@ -1201,7 +1233,7 @@ if (!$variants) {
|
||||
print '<span class="valignmiddle">';
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
} else {
|
||||
} elseif ($usercancreadprice) {
|
||||
print price($totalvaluesell / $total, 1);
|
||||
}
|
||||
print '</span>';
|
||||
@ -1212,7 +1244,7 @@ if (!$variants) {
|
||||
print '<td class="liste_total right amount">';
|
||||
if ($num) {
|
||||
print '<span class="valignmiddle">';
|
||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
if (empty($conf->global->PRODUIT_MULTIPRICES) && $usercancreadprice) {
|
||||
print price(price2num($totalvaluesell, 'MT'), 1);
|
||||
} else {
|
||||
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||
|
||||
@ -52,7 +52,7 @@ if ($page < 0) {
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -709,7 +709,7 @@ if (count($tasksarray) > 0) {
|
||||
|
||||
// Calculate total for all tasks
|
||||
$listofdistinctprojectid = array(); // List of all distinct projects
|
||||
if (is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) {
|
||||
if (!empty($tasksarraywithoutfilter) && is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) {
|
||||
foreach ($tasksarraywithoutfilter as $tmptask) {
|
||||
$listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project;
|
||||
}
|
||||
|
||||
@ -524,7 +524,7 @@ if (count($tasksarray) > 0) {
|
||||
|
||||
// Calculate total for all tasks
|
||||
$listofdistinctprojectid = array(); // List of all distinct projects
|
||||
if (is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) {
|
||||
if (!empty($tasksarraywithoutfilter) && is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) {
|
||||
foreach ($tasksarraywithoutfilter as $tmptask) {
|
||||
$listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project;
|
||||
}
|
||||
|
||||
@ -747,7 +747,7 @@ if (count($tasksarray) > 0) {
|
||||
|
||||
// Calculate total for all tasks
|
||||
$listofdistinctprojectid = array(); // List of all distinct projects
|
||||
if (is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) {
|
||||
if (!empty($tasksarraywithoutfilter) && is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) {
|
||||
foreach ($tasksarraywithoutfilter as $tmptask) {
|
||||
$listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project;
|
||||
}
|
||||
|
||||
@ -561,7 +561,9 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
// Ref
|
||||
$suggestedref = (GETPOST("ref") ? GETPOST("ref") : $defaultref);
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td class><input class="maxwidth150onsmartphone" type="text" name="ref" value="'.dol_escape_htmltag($suggestedref).'">';
|
||||
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
|
||||
if ($suggestedref) {
|
||||
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
|
||||
@ -2046,7 +2046,7 @@ class Project extends CommonObject
|
||||
$sql .= " AND pt.fk_projet = ".((int) $this->id);
|
||||
$sql .= " AND (ptt.task_date >= '".$this->db->idate($datestart)."' ";
|
||||
$sql .= " AND ptt.task_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'm') - 1)."')";
|
||||
if ($task_id) {
|
||||
if ($taskid) {
|
||||
$sql .= " AND ptt.fk_task=".((int) $taskid);
|
||||
}
|
||||
if (is_numeric($userid)) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
*
|
||||
|
||||
@ -1008,7 +1008,7 @@ if (!empty($arrayfields['c.assigned']['checked'])) {
|
||||
// Opp status
|
||||
if (!empty($arrayfields['p.fk_opp_status']['checked'])) {
|
||||
print '<td class="liste_titre nowrap center">';
|
||||
print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 0, 1, 0, 'maxwidth100 nowrapoption', 1, 0);
|
||||
print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth125 nowrapoption', 1, 1);
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['p.opp_amount']['checked'])) {
|
||||
@ -1267,6 +1267,9 @@ while ($i < $imaxinloop) {
|
||||
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Project url
|
||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
@ -1428,6 +1431,9 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Opp Status
|
||||
if (!empty($arrayfields['p.fk_opp_status']['checked'])) {
|
||||
@ -1612,7 +1618,7 @@ while ($i < $imaxinloop) {
|
||||
$userstatic->gender = $obj->gender;
|
||||
|
||||
if (!empty($arrayfields['u.login']['checked'])) {
|
||||
print '<td class="center tdoverflowmax200">';
|
||||
print '<td class="center tdoverflowmax150">';
|
||||
if ($userstatic->id) {
|
||||
print $userstatic->getNomUrl(-1);
|
||||
} else {
|
||||
@ -1672,9 +1678,9 @@ while ($i < $imaxinloop) {
|
||||
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -41,7 +41,7 @@ if ($user->socid > 0) {
|
||||
$action = '';
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year', 'int') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user