FIX resolve conflicts
This commit is contained in:
commit
bae3583fe3
@ -674,7 +674,7 @@ if ($id) {
|
||||
// Can an entry be erased or disabled ?
|
||||
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
|
||||
|
||||
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
|
||||
$url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
|
||||
if ($param) {
|
||||
$url .= '&'.$param;
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ $arrayfields = array(
|
||||
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
|
||||
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
|
||||
't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100),
|
||||
);
|
||||
|
||||
@ -769,16 +769,18 @@ if ($action == 'export_file') {
|
||||
|
||||
$form_question['separator'] = array('name'=>'separator', 'type'=>'separator');
|
||||
|
||||
// If 0 or not set, we NOT check by default.
|
||||
$checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE));
|
||||
$form_question['notifiedvalidationdate'] = array(
|
||||
'name' => 'notifiedvalidationdate',
|
||||
'type' => 'checkbox',
|
||||
'label' => $langs->trans('NotifiedValidationDate', $langs->transnoentitiesnoconv("MenuAccountancyClosure")),
|
||||
'value' => $checked,
|
||||
);
|
||||
if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) {
|
||||
// If 0 or not set, we NOT check by default.
|
||||
$checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE));
|
||||
$form_question['notifiedvalidationdate'] = array(
|
||||
'name' => 'notifiedvalidationdate',
|
||||
'type' => 'checkbox',
|
||||
'label' => $langs->trans('NotifiedValidationDate', $langs->transnoentitiesnoconv("MenuAccountancyClosure")),
|
||||
'value' => $checked,
|
||||
);
|
||||
|
||||
$form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator');
|
||||
$form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator');
|
||||
}
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ $arrayfields = array(
|
||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
|
||||
't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100),
|
||||
);
|
||||
|
||||
|
||||
@ -112,6 +112,7 @@ if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting-
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -178,20 +179,40 @@ for ($i = 1; $i <= 12; $i++) {
|
||||
}
|
||||
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
|
||||
|
||||
$sql = "SELECT COUNT(b.rowid) as detail,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
if (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) {
|
||||
// TODO Analyse is done by finding record not into a closed period
|
||||
$sql = "SELECT COUNT(b.rowid) as detail,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
$sql .= " SUM(".$db->ifsql("MONTH(b.doc_date)=".$j, "1", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||
}
|
||||
$sql .= " SUM(".$db->ifsql("MONTH(b.doc_date)=".$j, "1", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||
$sql .= " COUNT(b.rowid) as total";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
|
||||
$sql .= " WHERE b.doc_date >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND b.doc_date <= '".$db->idate($search_date_end)."'";
|
||||
$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
|
||||
// Loop on each closed period
|
||||
$sql .= " AND b.doc_date BETWEEN 0 AND 0";
|
||||
} else {
|
||||
// Analyse closed record using the unitary flag/date on each record
|
||||
$sql = "SELECT COUNT(b.rowid) as detail,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
$sql .= " SUM(".$db->ifsql("MONTH(b.doc_date)=".$j, "1", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
|
||||
}
|
||||
$sql .= " COUNT(b.rowid) as total";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
|
||||
$sql .= " WHERE b.doc_date >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND b.doc_date <= '".$db->idate($search_date_end)."'";
|
||||
$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND date_validated IS NULL";
|
||||
}
|
||||
$sql .= " COUNT(b.rowid) as total";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b";
|
||||
$sql .= " WHERE b.doc_date >= '".$db->idate($search_date_start)."'";
|
||||
$sql .= " AND b.doc_date <= '".$db->idate($search_date_end)."'";
|
||||
$sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND date_validated IS NULL";
|
||||
|
||||
dol_syslog('htdocs/accountancy/closure/index.php', LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -328,7 +328,7 @@ if ($action == 'writebookkeeping') {
|
||||
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
$accountingaccount->fetch($k, null, true); // TODO Use a cache for label
|
||||
$accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
|
||||
$account_label = $accountingaccount->label;
|
||||
|
||||
// get compte id and label
|
||||
|
||||
@ -457,7 +457,7 @@ if ($action == 'writebookkeeping') {
|
||||
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
$accountingaccount->fetch($k, null, true); // TODO Use a cache for label
|
||||
$accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
|
||||
$label_account = $accountingaccount->label;
|
||||
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
|
||||
@ -479,7 +479,7 @@ if ($action == 'writebookkeeping') {
|
||||
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
$accountingaccount->fetch($k, null, true); // TODO Use a cache for label
|
||||
$accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
|
||||
$label_account = $accountingaccount->label;
|
||||
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
|
||||
@ -236,7 +236,7 @@ if ($some_mandatory_steps_of_setup_were_not_done) {
|
||||
print ' : ' . $langs->trans("AccountancyAreaDescMisc", 4, '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("MenuDefaultAccounts") . '</strong>');
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
print '<div class="tabsAction tabsActionNoBottom centerimp">';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') {
|
||||
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
|
||||
}
|
||||
|
||||
@ -178,14 +178,14 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Value").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Force Type
|
||||
$adht = new AdherentType($db);
|
||||
print '<tr class="oddeven drag" id="trforcetype"><td>';
|
||||
print $langs->trans("ForceMemberType");
|
||||
print '</td><td class="right">';
|
||||
print '</td><td>';
|
||||
$listofval = array();
|
||||
$listofval += $adht->liste_array(1);
|
||||
$forcetype = empty($conf->global->MEMBER_NEWFORM_FORCETYPE) ? -1 : $conf->global->MEMBER_NEWFORM_FORCETYPE;
|
||||
@ -197,7 +197,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
print '<tr class="oddeven drag" id="trforcenature"><td>';
|
||||
print $langs->trans("ForceMemberNature");
|
||||
print '</td><td class="right">';
|
||||
print '</td><td>';
|
||||
$forcenature = empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY) ? 0 : $conf->global->MEMBER_NEWFORM_FORCEMORPHY;
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1);
|
||||
print "</td></tr>\n";
|
||||
@ -205,21 +205,21 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||
// Amount
|
||||
print '<tr class="oddeven" id="tramount"><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
print '</td><td class="right">';
|
||||
print '<input type="text" class="right width75" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="right width50" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Can edit
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("CanEditAmount");
|
||||
print '</td><td class="right">';
|
||||
print '</td><td>';
|
||||
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0), 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Jump to an online payment page
|
||||
print '<tr class="oddeven" id="trpayment"><td>';
|
||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||
print '</td><td class="right">';
|
||||
print '</td><td>';
|
||||
$listofval = array();
|
||||
$listofval['-1'] = $langs->trans('No');
|
||||
$listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')';
|
||||
|
||||
@ -1227,12 +1227,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.dol_escape_htmltag(GETPOSTISSET("pass") ? GETPOST("pass", 'none', 2) : $object->pass).'"></td></tr>';
|
||||
}
|
||||
// Morphy
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberNature").'</span></td><td>';
|
||||
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy") ? GETPOST("morphy", 'alpha') : $object->morphy), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print "</td></tr>";
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||
@ -1244,6 +1238,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
// Morphy
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberNature").'</span></td><td>';
|
||||
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy") ? GETPOST("morphy", 'alpha') : $object->morphy), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print "</td></tr>";
|
||||
|
||||
// Company
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET("societe") ? GETPOST("societe", 'alphanohtml', 2) : $object->company).'"></td></tr>';
|
||||
|
||||
@ -1511,7 +1512,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
|
||||
$labeltouse = getDolGlobalString("ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION");
|
||||
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
|
||||
|
||||
@ -598,7 +598,11 @@ while ($i < min($num, $limit)) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'd.amount';
|
||||
}
|
||||
$totalarray['val']['d.amount'] += $obj->subscription;
|
||||
if (empty($totalarray['val']['d.amount'])) {
|
||||
$totalarray['val']['d.amount'] = $obj->subscription;
|
||||
} else {
|
||||
$totalarray['val']['d.amount'] += $obj->subscription;
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
|
||||
@ -466,13 +466,13 @@ print '</form>';
|
||||
|
||||
//Use draft Watermark
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"set_BOM_DRAFT_WATERMARK\">";
|
||||
print '<input type="hidden" name="action" value="set_BOM_DRAFT_WATERMARK">';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.$conf->global->BOM_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('BOM_DRAFT_WATERMARK')).'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -64,7 +64,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
$help_url = '';
|
||||
llxHeader('', $langs->trans("BOMsSetup"), $help_url);
|
||||
|
||||
|
||||
|
||||
@ -625,13 +625,13 @@ print '</form>';
|
||||
|
||||
//Use draft Watermark
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"set_COMMANDE_DRAFT_WATERMARK\">";
|
||||
print '<input type="hidden" name="action" value="set_COMMANDE_DRAFT_WATERMARK">';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.getDolGlobalString('COMMANDE_DRAFT_WATERMARK').'">';
|
||||
print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('COMMANDE_DRAFT_WATERMARK')).'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -220,7 +220,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) {
|
||||
print '<td class="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
}
|
||||
print '<input type="submit" class="button button-add" name="add" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" class="button button-add small" name="add" value="'.$langs->trans("Add").'">';
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
@ -273,7 +273,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Date last change
|
||||
print '<td class="nowraponall">';
|
||||
print '<td class="nowraponall center">';
|
||||
print dol_print_date($db->jdate($obj->tms), 'dayhour');
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -458,7 +458,7 @@ print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.$conf->global->CONTRACT_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('CONTRACT_DRAFT_WATERMARK')).'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -206,7 +206,7 @@ class PrestaShopWebservice
|
||||
*/
|
||||
public function printDebug($title, $content)
|
||||
{
|
||||
echo '<div style="display:table;background:#CCC;font-size:8pt;padding:7px"><h6 style="font-size:9pt;margin:0">'.$title.'</h6><pre>'.htmlentities($content).'</pre></div>';
|
||||
echo '<div style="display:table;background:#CCC;font-size:8pt;padding:7px"><h6 style="font-size:9pt;margin:0">'.dol_escape_htmltag($title).'</h6><pre>'.dol_escape_htmltag($content).'</pre></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -451,7 +451,7 @@ print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.getDolGlobalString('SHIPPING_DRAFT_WATERMARK').'">';
|
||||
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('SHIPPING_DRAFT_WATERMARK')).'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -468,7 +468,7 @@ print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (!empty($conf->project->enabled)) {
|
||||
|
||||
@ -761,7 +761,7 @@ print '<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td>';
|
||||
print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />';
|
||||
print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FACTURE_DRAFT_WATERMARK')).'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -525,7 +525,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERM
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -551,7 +551,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.$conf->global->HOLIDAY_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('HOLIDAY_DRAFT_WATERMARK')).'">';
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ $type = 'myobject';
|
||||
|
||||
$arrayofparameters = array(
|
||||
'HRM_MAXRANK'=>array('type'=>'integer','enabled'=>1),
|
||||
'HRM_DEFAULT_SKILL_DESCRIPTION'=>array('type'=>'textarea','enabled'=>1),
|
||||
'HRM_DEFAULT_SKILL_DESCRIPTION'=>array('type'=>'varchar','enabled'=>1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
|
||||
@ -870,7 +870,7 @@ if ($action == 'edit') {
|
||||
if (!empty($dnsinfo) && is_array($dnsinfo)) {
|
||||
foreach ($dnsinfo as $info) {
|
||||
if (strpos($info['txt'], 'v=spf') !== false) {
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("ActualMailSPFRecordFound", $info['txt']);
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("ActualMailSPFRecordFound", $companyemail, $info['txt']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -505,7 +506,7 @@ if ($mode == 'feature') {
|
||||
$text .= '<br>';
|
||||
|
||||
$text .= '<br><strong>'.$langs->trans("AddHooks").':</strong> ';
|
||||
if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) {
|
||||
if (isset($objMod->module_parts) && isset($objMod->module_parts['hooks']) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) {
|
||||
$i = 0;
|
||||
foreach ($objMod->module_parts['hooks'] as $key => $val) {
|
||||
if ($key === 'entity') {
|
||||
|
||||
@ -465,7 +465,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_MRP_MO_DRAFT_WATERMARK
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftMOs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="MRP_MO_DRAFT_WATERMARK" value="'.$conf->global->MRP_MO_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="MRP_MO_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('MRP_MO_DRAFT_WATERMARK')).'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -693,7 +693,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_PROPALE_DRAFT_WATERMAR
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="PROPALE_DRAFT_WATERMARK" value="'.$conf->global->PROPALE_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="PROPALE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('PROPALE_DRAFT_WATERMARK')).'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -467,7 +467,7 @@ print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext).'<br>';
|
||||
print '<input class="flat minwidth200" type="text" name="RECEPTION_DRAFT_WATERMARK" value="'.$conf->global->RECEPTION_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="RECEPTION_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('RECEPTION_DRAFT_WATERMARK')).'">';
|
||||
print "</td></tr>\n";
|
||||
*/
|
||||
print '</table>';
|
||||
|
||||
@ -128,7 +128,7 @@ if (isset($max)) {
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb");
|
||||
print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.dol_escape_htmltag($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -138,7 +138,7 @@ print '<td>'.$langs->trans("UMask").'</td><td class="right">';
|
||||
print $form->textwithpicto('', $langs->trans("UMaskExplanation"));
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UMASK).'">';
|
||||
print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.dol_escape_htmltag($conf->global->MAIN_UMASK).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -61,8 +61,13 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
} elseif ($action == 'updateform') {
|
||||
$res1 = dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
$res2 = dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", GETPOST("MAIN_SESSION_TIMEOUT", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
$res1 = 1; $res2 = 1;
|
||||
if (GETPOSTISSET('MAIN_APPLICATION_TITLE')) {
|
||||
$res1 = dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (GETPOSTISSET('MAIN_SESSION_TIMEOUT')) {
|
||||
$res2 = dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", GETPOST("MAIN_SESSION_TIMEOUT", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if ($res1 && $res2) {
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
@ -165,11 +170,11 @@ if (ini_get("session.gc_probability") == 0) {
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
|
||||
print '<input class="flat right width50" name="MAIN_SESSION_TIMEOUT" type="text" value="'.dol_escape_htmltag($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
/*
|
||||
if (empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
$conf->global->MAIN_APPLICATION_TITLE = "";
|
||||
}
|
||||
@ -177,9 +182,10 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_APPLICATION_TITLE" type="text" size="20" value="'.htmlentities($conf->global->MAIN_APPLICATION_TITLE).'"> ';
|
||||
print '<input class="flat" name="MAIN_APPLICATION_TITLE" type="text" size="20" value="'.dol_escape_htmltag($conf->global->MAIN_APPLICATION_TITLE).'"> ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -492,7 +492,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAF
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('SUPPLIER_PROPOSAL_DRAFT_WATERMARK')).'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -295,7 +295,7 @@ print '</td></tr>';
|
||||
|
||||
if (!empty($conf->loghandlers['mod_syslog_file']) && !empty($conf->cron->enabled)) {
|
||||
print '<tr class="oddeven"><td width="140">'.$langs->trans("SyslogFileNumberOfSaves").'</td>';
|
||||
print '<td colspan="2"><input type="number" name="file_saves" placeholder="14" min="0" step="1" value="'.$conf->global->SYSLOG_FILE_SAVES.'" />';
|
||||
print '<td colspan="2"><input type="number" name="file_saves" placeholder="14" min="0" step="1" value="'.getDolGlobalString('SYSLOG_FILE_SAVES').'" />';
|
||||
print ' (<a href="'.dol_buildpath('/cron/list.php', 1).'?search_label=CompressSyslogs&status=-1">'.$langs->trans('ConfigureCleaningCronjobToSetFrequencyOfSaves').'</a>)</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -106,6 +106,14 @@ if (!$base) {
|
||||
print '<td class="right">Collation</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$arrayoffilesrich = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, '\.sql$');
|
||||
$arrayoffiles = array();
|
||||
foreach ($arrayoffilesrich as $value) {
|
||||
//print $shortsqlfilename.' ';
|
||||
$shortsqlfilename = preg_replace('/\-[a-z]+\./', '.', $value['name']);
|
||||
$arrayoffiles[] = $shortsqlfilename;
|
||||
}
|
||||
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@ -119,7 +127,8 @@ if (!$base) {
|
||||
print '<td>'.($i+1).'</td>';
|
||||
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a>';
|
||||
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
|
||||
if (dol_is_file(DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql')) {
|
||||
|
||||
if (in_array($tablename.'.sql', $arrayoffiles)) {
|
||||
$img = "info";
|
||||
//print img_picto($langs->trans("ExternalModule"), $img);
|
||||
} else {
|
||||
|
||||
@ -183,7 +183,8 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
|
||||
}
|
||||
|
||||
// enable captcha by default
|
||||
$res = dolibarr_set_const($db, 'MAIN_SECURITY_ENABLECAPTCHA', 1, 'chaine', 0, '', $conf->entity);
|
||||
// TODO Add a visible option in this setup page for this
|
||||
$res = dolibarr_set_const($db, 'MAIN_SECURITY_ENABLECAPTCHA_TICKET', 1, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
$errors[] = $db->lasterror();
|
||||
|
||||
@ -58,7 +58,7 @@ if ($action == 'set_default') {
|
||||
} elseif ($action == 'del_default') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
if ($conf->global->USERGROUP_ADDON_PDF_ODT == "$value") {
|
||||
if (getDolGlobalString('USERGROUP_ADDON_PDF_ODT') == "$value") {
|
||||
dolibarr_del_const($db, 'USERGROUP_ADDON_PDF_ODT', $conf->entity);
|
||||
}
|
||||
}
|
||||
@ -202,7 +202,7 @@ foreach ($dirmodels as $reldir) {
|
||||
|
||||
// Defaut
|
||||
print '<td class="center">';
|
||||
if ($conf->global->USERGROUP_ADDON_PDF == $name) {
|
||||
if (getDolGlobalString('USERGROUP_ADDON_PDF') == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scandir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
|
||||
@ -827,7 +827,7 @@ class Categorie extends CommonObject
|
||||
/**
|
||||
* Return list of fetched instance of elements having this category
|
||||
*
|
||||
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management' ...)
|
||||
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member', 'knowledge_management', ...)
|
||||
* @param int $onlyids Return only ids of objects (consume less memory)
|
||||
* @param int $limit Limit
|
||||
* @param int $offset Offset
|
||||
@ -1215,9 +1215,10 @@ class Categorie extends CommonObject
|
||||
while ((empty($protection) || $i < $protection) && !empty($this->motherof[$cursor_categ])) {
|
||||
//print ' cursor_categ='.$cursor_categ.' i='.$i.' '.$this->motherof[$cursor_categ].'<br>'."\n";
|
||||
$this->cats[$id_categ]['fullpath'] = '_'.$this->motherof[$cursor_categ].$this->cats[$id_categ]['fullpath'];
|
||||
$this->cats[$id_categ]['fulllabel'] = $this->cats[$this->motherof[$cursor_categ]]['label'].' >> '.$this->cats[$id_categ]['fulllabel'];
|
||||
$this->cats[$id_categ]['fulllabel'] = (empty($this->cats[$this->motherof[$cursor_categ]]) ? 'NotFound' : $this->cats[$this->motherof[$cursor_categ]]['label']).' >> '.$this->cats[$id_categ]['fulllabel'];
|
||||
//print ' Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].' '.$this->cats[$id_categ]['fulllabel'].'<br>'."\n";
|
||||
$i++; $cursor_categ = $this->motherof[$cursor_categ];
|
||||
$i++;
|
||||
$cursor_categ = $this->motherof[$cursor_categ];
|
||||
}
|
||||
//print 'Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].'<br>'."\n";
|
||||
|
||||
|
||||
@ -381,7 +381,7 @@ if ($cats < 0) {
|
||||
$fulltree = $categstatic->get_full_arbo($type, $object->id, 1);
|
||||
|
||||
// Load possible missing includes
|
||||
if ($conf->global->CATEGORY_SHOW_COUNTS) {
|
||||
if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) {
|
||||
if ($type == Categorie::TYPE_MEMBER) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
}
|
||||
@ -407,11 +407,9 @@ if ($cats < 0) {
|
||||
$desc = dol_htmlcleanlastbr($val['description']);
|
||||
|
||||
$counter = '';
|
||||
if ($conf->global->CATEGORY_SHOW_COUNTS) {
|
||||
if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) {
|
||||
// we need only a count of the elements, so it is enough to consume only the id's from the database
|
||||
$elements = $type == Categorie::TYPE_ACCOUNT
|
||||
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
|
||||
: $categstatic->getObjectsInCateg($type, 1);
|
||||
$elements = $categstatic->getObjectsInCateg($type, 1);
|
||||
|
||||
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
|
||||
}
|
||||
@ -1047,7 +1045,7 @@ if ($type == Categorie::TYPE_USER) {
|
||||
print '<input type="hidden" name="action" value="addintocategory">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>';
|
||||
print $langs->trans("AddProjectIntoCategory").' ';
|
||||
print $langs->trans("AddObjectIntoCategory").' ';
|
||||
print $form->select_dolusers('', 'elemid');
|
||||
print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -1903,13 +1903,22 @@ if ($id > 0) {
|
||||
} else {
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
// Clone event
|
||||
if ($action == 'clone') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.GETPOST('id'), $langs->trans('ToClone'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
|
||||
print $formconfirm;
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.GETPOST('id'), $langs->trans('ToClone'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', array(), 'yes', 1);
|
||||
}
|
||||
|
||||
// Call Hook formConfirm
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
$linkback = '';
|
||||
// Link to other agenda views
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
|
||||
@ -914,8 +914,10 @@ if ($object->id > 0) {
|
||||
* Latest orders
|
||||
*/
|
||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$param ="";
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid";
|
||||
$sql .= ", c.rowid as cid, c.total_ht";
|
||||
$sql .= ", c.rowid as cid, c.entity, c.total_ht";
|
||||
$sql .= ", c.total_tva";
|
||||
$sql .= ", c.total_ttc";
|
||||
$sql .= ", c.ref, c.ref_client, c.fk_statut, c.facture";
|
||||
@ -1024,7 +1026,7 @@ if ($object->id > 0) {
|
||||
*/
|
||||
if (!empty($conf->expedition->enabled) && $user->rights->expedition->lire) {
|
||||
$sql = 'SELECT e.rowid as id';
|
||||
$sql .= ', e.ref';
|
||||
$sql .= ', e.ref, e.entity';
|
||||
$sql .= ', e.date_creation';
|
||||
$sql .= ', e.fk_statut as statut';
|
||||
$sql .= ', s.nom';
|
||||
@ -1033,7 +1035,7 @@ if ($object->id > 0) {
|
||||
$sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
|
||||
$sql .= " AND e.entity IN (".getEntity('expedition').")";
|
||||
$sql .= ' GROUP BY e.rowid';
|
||||
$sql .= ', e.ref';
|
||||
$sql .= ', e.ref, e.entity';
|
||||
$sql .= ', e.date_creation';
|
||||
$sql .= ', e.fk_statut';
|
||||
$sql .= ', s.nom';
|
||||
|
||||
@ -41,7 +41,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element = 'advtargetemailing';
|
||||
public $table_element = 'mailing_advtarget';
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
@ -159,7 +159,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
// Put here code to add control on parameters values
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."advtargetemailing(";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_advtarget(";
|
||||
$sql .= "name,";
|
||||
$sql .= "entity,";
|
||||
$sql .= "fk_element,";
|
||||
@ -188,7 +188,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."advtargetemailing");
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."mailing_advtarget");
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -227,7 +227,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sql .= " t.fk_user_mod,";
|
||||
$sql .= " t.tms";
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as t";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as t";
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
@ -282,7 +282,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sql .= " t.fk_user_mod,";
|
||||
$sql .= " t.tms";
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as t";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as t";
|
||||
if (!empty($id)) {
|
||||
$sql .= " WHERE t.fk_element = ".((int) $id)." AND type_element = 'mailing'";
|
||||
} else {
|
||||
@ -345,7 +345,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sql .= " t.fk_user_mod,";
|
||||
$sql .= " t.tms";
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as t";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as t";
|
||||
if (!empty($id)) {
|
||||
$sql .= " WHERE t.fk_element = ".((int) $id)." AND type_element = '".$this->db->escape($type_element)."'";
|
||||
} else {
|
||||
@ -410,7 +410,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
// Put here code to add a control on parameters values
|
||||
|
||||
// Update request
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."advtargetemailing SET";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_advtarget SET";
|
||||
|
||||
$sql .= " name=".(isset($this->name) ? "'".$this->db->escape($this->name)."'" : "''").",";
|
||||
$sql .= " entity=".$conf->entity.",";
|
||||
@ -458,7 +458,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."advtargetemailing";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_advtarget";
|
||||
$sql .= " WHERE rowid=".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::delete sql=".$sql);
|
||||
|
||||
@ -1217,7 +1217,7 @@ if ($resql) {
|
||||
if ($permissiontocancel) {
|
||||
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
|
||||
}
|
||||
if ($user->rights->facture->creer) {
|
||||
if (!empty($conf->invoice->enabled) && $user->rights->facture->creer) {
|
||||
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
|
||||
}
|
||||
if ($permissiontoclose) {
|
||||
|
||||
@ -2390,7 +2390,7 @@ class AccountLine extends CommonObject
|
||||
|
||||
$result = '';
|
||||
|
||||
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Transaction").'</u>:<br>';
|
||||
$label = img_picto('', $this->picto).' <u>'.$langs->trans("BankTransactionLine").'</u>:<br>';
|
||||
$label .= '<b>'.$langs->trans("Ref").':</b> '.$this->ref;
|
||||
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.((int) $this->id).'&save_lastsearch_values=1" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
|
||||
@ -606,45 +606,20 @@ class PaymentVarious extends CommonObject
|
||||
public function LibStatut($status, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0) {
|
||||
return $langs->trans($this->statuts[$status]);
|
||||
} elseif ($mode == 1) {
|
||||
return $langs->trans($this->statuts_short[$status]);
|
||||
} elseif ($mode == 2) {
|
||||
if ($status == 0) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
|
||||
} elseif ($status == 1) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
|
||||
} elseif ($status == 2) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
|
||||
}
|
||||
} elseif ($mode == 3) {
|
||||
if ($status == 0 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
|
||||
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
|
||||
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
|
||||
}
|
||||
} elseif ($mode == 4) {
|
||||
if ($status == 0 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
|
||||
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
|
||||
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
|
||||
}
|
||||
} elseif ($mode == 5) {
|
||||
if ($status == 0 && !empty($this->statuts_short[$status])) {
|
||||
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
|
||||
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
|
||||
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
|
||||
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
|
||||
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
|
||||
}
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("mymodule@mymodule");
|
||||
/*$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
|
||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
||||
$this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
|
||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
||||
$this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');*/
|
||||
}
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
|
||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -588,6 +588,8 @@ if ($id) {
|
||||
$morehtmlref .= '</div>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlright = '';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
@ -617,7 +619,7 @@ if ($id) {
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("Sens").'</td><td>'.$sens.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>';
|
||||
|
||||
// Accountancy code
|
||||
print '<tr><td class="nowrap">';
|
||||
|
||||
@ -537,6 +537,8 @@ if ($resql) {
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$totalarray['val']['total_cred'] = 0;
|
||||
$totalarray['val']['total_deb'] = 0;
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
@ -100,6 +100,8 @@ class Deplacement extends CommonObject
|
||||
|
||||
public $statuts = array();
|
||||
public $statuts_short = array();
|
||||
public $statuts_logo = array();
|
||||
|
||||
|
||||
/**
|
||||
* Draft status
|
||||
@ -127,6 +129,7 @@ class Deplacement extends CommonObject
|
||||
|
||||
$this->statuts_short = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded');
|
||||
$this->statuts = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded');
|
||||
$this->statuts_logo = array(0 => 'status0', 1=>'status4', 2 => 'status1', 4 => 'status6', 5 => 'status4', 6 => 'status6', 99 => 'status5');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -358,43 +361,12 @@ class Deplacement extends CommonObject
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0) {
|
||||
return $langs->trans($this->statuts[$status]);
|
||||
} elseif ($mode == 1) {
|
||||
return $langs->trans($this->statuts_short[$status]);
|
||||
} elseif ($mode == 2) {
|
||||
if ($status == 0) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
|
||||
} elseif ($status == 1) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
|
||||
} elseif ($status == 2) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
|
||||
}
|
||||
} elseif ($mode == 3) {
|
||||
if ($status == 0 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
|
||||
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
|
||||
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
|
||||
}
|
||||
} elseif ($mode == 4) {
|
||||
if ($status == 0 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
|
||||
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
|
||||
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
|
||||
return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
|
||||
}
|
||||
} elseif ($mode == 5) {
|
||||
if ($status == 0 && !empty($this->statuts_short[$status])) {
|
||||
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
|
||||
} elseif ($status == 1 && !empty($this->statuts_short[$status])) {
|
||||
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
|
||||
} elseif ($status == 2 && !empty($this->statuts_short[$status])) {
|
||||
return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
|
||||
}
|
||||
}
|
||||
$labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]);
|
||||
$labelStatusShort = $langs->transnoentitiesnoconv($this->statuts_short[$status]);
|
||||
|
||||
$statusType = $this->statuts_logo[$status];
|
||||
|
||||
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -668,6 +668,8 @@ class Invoices extends DolibarrApi
|
||||
$result = $this->invoice->delete(DolibarrApiAccess::$user);
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when deleting invoice');
|
||||
} elseif ($result == 0) {
|
||||
throw new RestException(403, 'Invoice not erasable');
|
||||
}
|
||||
|
||||
return array(
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -108,7 +109,7 @@ llxHeader('', $langs->trans("WithdrawalsLines"));
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
|
||||
$sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc";
|
||||
$sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.email";
|
||||
$sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.email";
|
||||
$sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
@ -139,7 +140,7 @@ if ($search_bon) {
|
||||
}
|
||||
if ($type == 'bank-transfer') {
|
||||
if ($search_code) {
|
||||
$sql .= natural_search("s.code_fourn", $search_code);
|
||||
$sql .= natural_search("s.code_fournisseur", $search_code);
|
||||
}
|
||||
} else {
|
||||
if ($search_code) {
|
||||
@ -172,6 +173,9 @@ if ($result) {
|
||||
|
||||
$param = "&statut=".urlencode($statut);
|
||||
$param .= "&search_bon=".urlencode($search_bon);
|
||||
if ($type == 'bank-transfer') {
|
||||
$param .= '&type=bank-transfer';
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
@ -204,7 +208,7 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
|
||||
print '<td class="liste_titre center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
@ -214,8 +218,12 @@ if ($result) {
|
||||
print '</tr>';
|
||||
|
||||
$columntitle = "WithdrawalsReceipts";
|
||||
$columntitlethirdparty = "CustomerCode";
|
||||
$columncodethirdparty = "s.code_client";
|
||||
if ($type == 'bank-transfer') {
|
||||
$columntitle = "BankTransferReceipts";
|
||||
$columntitlethirdparty = "SupplierCode";
|
||||
$columncodethirdparty = "s.code_fournisseur";
|
||||
}
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -223,7 +231,7 @@ if ($result) {
|
||||
print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($columntitlethirdparty, $_SERVER["PHP_SELF"], $columncodethirdparty, '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('');
|
||||
@ -256,9 +264,17 @@ if ($result) {
|
||||
print '</a></td>';
|
||||
|
||||
print '<td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">';
|
||||
print img_object($langs->trans("ShowBill"), "bill");
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->invoiceref."</a></td>\n";
|
||||
$link_to_bill = '/compta/facture/card.php?facid=';
|
||||
$link_title = 'Invoice';
|
||||
$link_picto = 'bill';
|
||||
if ($type == 'bank-transfer') {
|
||||
$link_to_bill = '/fourn/facture/card.php?facid=';
|
||||
$link_title = 'SupplierInvoice';
|
||||
$link_picto = 'supplier_invoice';
|
||||
}
|
||||
print '<a href="'.DOL_URL_ROOT.$link_to_bill.$obj->facid.'">';
|
||||
print img_object($langs->trans($link_title), $link_picto);
|
||||
print ' '.$obj->invoiceref."</td>\n";
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
@ -266,7 +282,15 @@ if ($result) {
|
||||
print $company->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
|
||||
|
||||
print '<td class="center">';
|
||||
$link_to_tab = '/comm/card.php?socid=';
|
||||
$link_code = $obj->code_client;
|
||||
if ($type == 'bank-transfer') {
|
||||
$link_to_tab = '/fourn/card.php?socid=';
|
||||
$link_code = $obj->code_fournisseur;
|
||||
}
|
||||
print '<a href="'.DOL_URL_ROOT.$link_to_tab.$company->id.'">'.$link_code."</a></td>\n";
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
|
||||
|
||||
|
||||
@ -132,6 +132,9 @@ if ($result) {
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($type == 'bank-transfer') {
|
||||
$param .= '&type=bank-transfer';
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
|
||||
@ -1199,6 +1199,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Categories
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
$arrayselected = array();
|
||||
print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td>';
|
||||
print '<td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, null, null, null, 1);
|
||||
|
||||
@ -167,7 +167,7 @@ if ($object->thirdparty->client) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) {
|
||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
|
||||
$elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions');
|
||||
}
|
||||
|
||||
|
||||
@ -342,6 +342,9 @@ $formother = new FormOther($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$contactstatic = new Contact($db);
|
||||
|
||||
$morejs=array();
|
||||
$morecss = array();
|
||||
|
||||
if (!empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) {
|
||||
$contactstatic->loadCacheOfProspStatus();
|
||||
}
|
||||
|
||||
@ -1263,9 +1263,9 @@ if ($action == 'create') {
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("CloseAContract"), $langs->trans("ConfirmCloseContract"), "confirm_close", '', 0, 1);
|
||||
} elseif ($action == 'activate') {
|
||||
$formquestion = array(
|
||||
array('type' => 'date', 'name' => 'd_start', 'label' => $langs->trans("DateServiceActivate"), /*'value' => $form->selectDate('', '', $usehm, $usehm, '', "active", 1, 0),*/ /*'socid', '(s.client=1 OR s.client=2 OR s.client=3)'*/),
|
||||
array('type' => 'date', 'name' => 'd_start', 'label' => $langs->trans("DateServiceActivate"), 'value' => dol_now()),
|
||||
array('type' => 'date', 'name' => 'd_end', 'label' => $langs->trans("DateEndPlanned"), /*'value' => $form->selectDate('', "end", $usehm, $usehm, '', "active", 1, 0),*/ '', ''),
|
||||
array('type' => 'text', 'name' => 'comment', 'label' => $langs->trans("Comment"), 'value' => '', '', '', 'class' => 'minwidth300')
|
||||
array('type' => 'text', 'name' => 'comment', 'label' => $langs->trans("Comment"), 'value' => '', '', '', 'class' => 'minwidth300', 'moreattr'=>'autofocus')
|
||||
);
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ActivateAllOnContract"), $langs->trans("ConfirmActivateAllOnContract"), "confirm_activate", $formquestion, 'yes', 1, 280);
|
||||
} elseif ($action == 'clone') {
|
||||
|
||||
@ -61,7 +61,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
continue; // The field was not submited to be saved
|
||||
}
|
||||
} else {
|
||||
if (!GETPOSTISSET($key)) {
|
||||
if (!GETPOSTISSET($key) && !preg_match('/^chkbxlst:/', $object->fields[$key]['type'])) {
|
||||
continue; // The field was not submited to be saved
|
||||
}
|
||||
}
|
||||
@ -91,6 +91,12 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
} elseif ($object->fields[$key]['type'] == 'reference') {
|
||||
$tmparraykey = array_keys($object->param_list);
|
||||
$value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2');
|
||||
} elseif (preg_match('/^chkbxlst:(.*)/', $object->fields[$key]['type'])) {
|
||||
$value = '';
|
||||
$values_arr = GETPOST($key, 'array');
|
||||
if (!empty($values_arr)) {
|
||||
$value = implode(',', $values_arr);
|
||||
}
|
||||
} else {
|
||||
if ($key == 'lang') {
|
||||
$value = GETPOST($key, 'aZ09') ?GETPOST($key, 'aZ09') : "";
|
||||
@ -134,6 +140,8 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$result = $object->create($user);
|
||||
if ($result > 0) {
|
||||
// Creation OK
|
||||
@ -141,14 +149,19 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
$categories = GETPOST('categories', 'array:int');
|
||||
$object->setCategories($categories);
|
||||
}
|
||||
|
||||
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
|
||||
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
|
||||
|
||||
$db->commit();
|
||||
|
||||
if (empty($noback)) {
|
||||
header("Location: " . $urltogo);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$db->rollback();
|
||||
|
||||
$error++;
|
||||
// Creation KO
|
||||
if (!empty($object->errors)) {
|
||||
@ -177,7 +190,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (!GETPOSTISSET($key)) {
|
||||
if (!GETPOSTISSET($key) && !preg_match('/^chkbxlst:/', $object->fields[$key]['type'])) {
|
||||
continue; // The field was not submited to be saved
|
||||
}
|
||||
}
|
||||
@ -215,6 +228,12 @@ if ($action == 'update' && !empty($permissiontoadd)) {
|
||||
$value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0);
|
||||
} elseif ($object->fields[$key]['type'] == 'reference') {
|
||||
$value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2');
|
||||
} elseif (preg_match('/^chkbxlst:/', $object->fields[$key]['type'])) {
|
||||
$value = '';
|
||||
$values_arr = GETPOST($key, 'array');
|
||||
if (!empty($values_arr)) {
|
||||
$value = implode(',', $values_arr);
|
||||
}
|
||||
} else {
|
||||
if ($key == 'lang') {
|
||||
$value = GETPOST($key, 'aZ09');
|
||||
|
||||
@ -895,7 +895,12 @@ abstract class CommonDocGenerator
|
||||
//Add value to store price with currency
|
||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
|
||||
} elseif ($extrafields->attributes[$object->table_element]['type'][$key] == 'select') {
|
||||
$object->array_options['options_'.$key] = $extrafields->attributes[$object->table_element]['param'][$key]['options'][$object->array_options['options_'.$key]];
|
||||
$valueofselectkey = $object->array_options['options_'.$key];
|
||||
if (array_key_exists($valueofselectkey, $extrafields->attributes[$object->table_element]['param'][$key]['options'])) {
|
||||
$object->array_options['options_'.$key] = $extrafields->attributes[$object->table_element]['param'][$key]['options'][$valueofselectkey];
|
||||
} else {
|
||||
$object->array_options['options_'.$key] = '';
|
||||
}
|
||||
} elseif ($extrafields->attributes[$object->table_element]['type'][$key] == 'checkbox') {
|
||||
$valArray = explode(',', $object->array_options['options_'.$key]);
|
||||
$output = array();
|
||||
@ -945,7 +950,11 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
}
|
||||
|
||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
|
||||
if (array_key_exists('option_'.$key, $object->array_options)) {
|
||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
|
||||
} else {
|
||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => ''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -588,6 +588,10 @@ abstract class CommonObject
|
||||
public $alreadypaid;
|
||||
|
||||
|
||||
private $labelStatus;
|
||||
private $labelStatusShort;
|
||||
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
@ -6763,6 +6767,9 @@ abstract class CommonObject
|
||||
} elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) {
|
||||
$param['options'] = array($reg[2].':'.$reg[3] => 'N');
|
||||
$type = 'sellist';
|
||||
} elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) {
|
||||
$param['options'] = array($reg[1] => 'N');
|
||||
$type = 'chkbxlst';
|
||||
} elseif (preg_match('/varchar\((\d+)\)/', $val['type'], $reg)) {
|
||||
$param['options'] = array();
|
||||
$type = 'varchar';
|
||||
@ -6865,7 +6872,7 @@ abstract class CommonObject
|
||||
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
|
||||
} elseif (preg_match('/varchar/', $type)) {
|
||||
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'"'.($size > 0 ? ' maxlength="'.$size.'"' : '').' value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
|
||||
} elseif (in_array($type, array('mail', 'phone', 'url'))) {
|
||||
} elseif (in_array($type, array('email', 'mail', 'phone', 'url', 'ip'))) {
|
||||
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
|
||||
} elseif (preg_match('/^text/', $type)) {
|
||||
if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field
|
||||
@ -6916,7 +6923,9 @@ abstract class CommonObject
|
||||
if ((string) $keyb == '') {
|
||||
continue;
|
||||
}
|
||||
if (strpos($valb, "|") !== false) list($valb, $parent) = explode('|', $valb);
|
||||
if (strpos($valb, "|") !== false) {
|
||||
list($valb, $parent) = explode('|', $valb);
|
||||
}
|
||||
$out .= '<option value="'.$keyb.'"';
|
||||
$out .= (((string) $value == (string) $keyb) ? ' selected' : '');
|
||||
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
|
||||
@ -6941,6 +6950,8 @@ abstract class CommonObject
|
||||
// 2 : key fields name (if differ of rowid)
|
||||
// 3 : key field parent (for dependent lists)
|
||||
// 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value
|
||||
// 5 : id category type
|
||||
// 6 : ids categories list separated by comma for category root
|
||||
$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
|
||||
|
||||
if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
|
||||
@ -6955,112 +6966,130 @@ abstract class CommonObject
|
||||
$keyList .= ', '.$parentField;
|
||||
}
|
||||
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
$filter_categorie = false;
|
||||
if (count($InfoFieldList) > 5) {
|
||||
if ($InfoFieldList[0] == 'categorie') {
|
||||
$filter_categorie = true;
|
||||
}
|
||||
}
|
||||
|
||||
$sqlwhere = '';
|
||||
$sql = "SELECT ".$keyList;
|
||||
$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
|
||||
if (!empty($InfoFieldList[4])) {
|
||||
// can use SELECT request
|
||||
if (strpos($InfoFieldList[4], '$SEL$') !== false) {
|
||||
$InfoFieldList[4] = str_replace('$SEL$', 'SELECT', $InfoFieldList[4]);
|
||||
if ($filter_categorie === false) {
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
|
||||
// current object id can be use into filter
|
||||
if (strpos($InfoFieldList[4], '$ID$') !== false && !empty($objectid)) {
|
||||
$InfoFieldList[4] = str_replace('$ID$', $objectid, $InfoFieldList[4]);
|
||||
} else {
|
||||
$InfoFieldList[4] = str_replace('$ID$', '0', $InfoFieldList[4]);
|
||||
}
|
||||
|
||||
//We have to join on extrafield table
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
|
||||
$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
|
||||
} else {
|
||||
$sqlwhere .= " WHERE ".$InfoFieldList[4];
|
||||
}
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE 1=1';
|
||||
}
|
||||
// Some tables may have field, some other not. For the moment we disable it.
|
||||
if (in_array($InfoFieldList[0], array('tablewithentity'))) {
|
||||
$sqlwhere .= " AND entity = ".((int) $conf->entity);
|
||||
}
|
||||
$sql .= $sqlwhere;
|
||||
//print $sql;
|
||||
|
||||
$sql .= ' ORDER BY '.implode(', ', $fields_label);
|
||||
|
||||
dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$out .= '<option value="0"> </option>';
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$labeltoshow = '';
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$notrans = false;
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (count($fields_label) > 1) {
|
||||
$notrans = true;
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$labeltoshow .= $obj->$field_toshow.' ';
|
||||
}
|
||||
} else {
|
||||
$labeltoshow = $obj->{$InfoFieldList[1]};
|
||||
$sqlwhere = '';
|
||||
$sql = "SELECT " . $keyList;
|
||||
$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
|
||||
if (!empty($InfoFieldList[4])) {
|
||||
// can use SELECT request
|
||||
if (strpos($InfoFieldList[4], '$SEL$') !== false) {
|
||||
$InfoFieldList[4] = str_replace('$SEL$', 'SELECT', $InfoFieldList[4]);
|
||||
}
|
||||
$labeltoshow = dol_trunc($labeltoshow, 45);
|
||||
|
||||
if ($value == $obj->rowid) {
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
if ($translabel != $obj->$field_toshow) {
|
||||
$labeltoshow = dol_trunc($translabel).' ';
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->$field_toshow).' ';
|
||||
}
|
||||
}
|
||||
$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
|
||||
// current object id can be use into filter
|
||||
if (strpos($InfoFieldList[4], '$ID$') !== false && !empty($objectid)) {
|
||||
$InfoFieldList[4] = str_replace('$ID$', $objectid, $InfoFieldList[4]);
|
||||
} else {
|
||||
if (!$notrans) {
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$labeltoshow = dol_trunc($translabel, 18);
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]});
|
||||
$InfoFieldList[4] = str_replace('$ID$', '0', $InfoFieldList[4]);
|
||||
}
|
||||
|
||||
//We have to join on extrafield table
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
|
||||
$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
|
||||
} else {
|
||||
$sqlwhere .= " WHERE " . $InfoFieldList[4];
|
||||
}
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE 1=1';
|
||||
}
|
||||
// Some tables may have field, some other not. For the moment we disable it.
|
||||
if (in_array($InfoFieldList[0], array('tablewithentity'))) {
|
||||
$sqlwhere .= " AND entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$sql .= $sqlwhere;
|
||||
//print $sql;
|
||||
|
||||
$sql .= ' ORDER BY ' . implode(', ', $fields_label);
|
||||
|
||||
dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$out .= '<option value="0"> </option>';
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$labeltoshow = '';
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$notrans = false;
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (count($fields_label) > 1) {
|
||||
$notrans = true;
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$labeltoshow .= $obj->$field_toshow . ' ';
|
||||
}
|
||||
} else {
|
||||
$labeltoshow = $obj->{$InfoFieldList[1]};
|
||||
}
|
||||
if (empty($labeltoshow)) {
|
||||
$labeltoshow = '(not defined)';
|
||||
}
|
||||
$labeltoshow = dol_trunc($labeltoshow, 45);
|
||||
|
||||
if ($value == $obj->rowid) {
|
||||
$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
if ($translabel != $obj->$field_toshow) {
|
||||
$labeltoshow = dol_trunc($translabel) . ' ';
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
|
||||
}
|
||||
}
|
||||
$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
|
||||
} else {
|
||||
if (!$notrans) {
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$labeltoshow = dol_trunc($translabel, 18);
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]});
|
||||
}
|
||||
}
|
||||
if (empty($labeltoshow)) {
|
||||
$labeltoshow = '(not defined)';
|
||||
}
|
||||
if ($value == $obj->rowid) {
|
||||
$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
|
||||
}
|
||||
|
||||
if (!empty($InfoFieldList[3]) && $parentField) {
|
||||
$parent = $parentName . ':' . $obj->{$parentField};
|
||||
$isDependList = 1;
|
||||
}
|
||||
|
||||
$out .= '<option value="' . $obj->rowid . '"';
|
||||
$out .= ($value == $obj->rowid ? ' selected' : '');
|
||||
$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
|
||||
$out .= '>' . $labeltoshow . '</option>';
|
||||
}
|
||||
|
||||
if (!empty($InfoFieldList[3]) && $parentField) {
|
||||
$parent = $parentName.':'.$obj->{$parentField};
|
||||
$isDependList = 1;
|
||||
}
|
||||
|
||||
$out .= '<option value="'.$obj->rowid.'"';
|
||||
$out .= ($value == $obj->rowid ? ' selected' : '');
|
||||
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
|
||||
$out .= '>'.$labeltoshow.'</option>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
|
||||
}
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
|
||||
$out .= '<option value="0"> </option>';
|
||||
foreach ($data as $data_key => $data_value) {
|
||||
$out .= '<option value="' . $data_key . '"';
|
||||
$out .= ($value == $data_key ? ' selected' : '');
|
||||
$out .= '>' . $data_value . '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$out .= '</select>';
|
||||
@ -7093,6 +7122,8 @@ abstract class CommonObject
|
||||
// 2 : key fields name (if differ of rowid)
|
||||
// 3 : key field parent (for dependent lists)
|
||||
// 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value
|
||||
// 5 : id category type
|
||||
// 6 : ids categories list separated by comma for category root
|
||||
$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
|
||||
|
||||
if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
|
||||
@ -7107,114 +7138,127 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
$filter_categorie = false;
|
||||
if (count($InfoFieldList) > 5) {
|
||||
if ($InfoFieldList[0] == 'categorie') {
|
||||
$filter_categorie = true;
|
||||
}
|
||||
}
|
||||
|
||||
$sqlwhere = '';
|
||||
$sql = "SELECT ".$keyList;
|
||||
$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
|
||||
if (!empty($InfoFieldList[4])) {
|
||||
// can use SELECT request
|
||||
if (strpos($InfoFieldList[4], '$SEL$') !== false) {
|
||||
$InfoFieldList[4] = str_replace('$SEL$', 'SELECT', $InfoFieldList[4]);
|
||||
if ($filter_categorie === false) {
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
|
||||
// current object id can be use into filter
|
||||
if (strpos($InfoFieldList[4], '$ID$') !== false && !empty($objectid)) {
|
||||
$InfoFieldList[4] = str_replace('$ID$', $objectid, $InfoFieldList[4]);
|
||||
} else {
|
||||
$InfoFieldList[4] = str_replace('$ID$', '0', $InfoFieldList[4]);
|
||||
}
|
||||
|
||||
// We have to join on extrafield table
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
|
||||
$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
|
||||
} else {
|
||||
$sqlwhere .= " WHERE ".$InfoFieldList[4];
|
||||
}
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE 1=1';
|
||||
}
|
||||
// Some tables may have field, some other not. For the moment we disable it.
|
||||
if (in_array($InfoFieldList[0], array('tablewithentity'))) {
|
||||
$sqlwhere .= " AND entity = ".((int) $conf->entity);
|
||||
}
|
||||
// $sql.=preg_replace('/^ AND /','',$sqlwhere);
|
||||
// print $sql;
|
||||
|
||||
$sql .= $sqlwhere;
|
||||
dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$data = array();
|
||||
|
||||
while ($i < $num) {
|
||||
$labeltoshow = '';
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$notrans = false;
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (count($fields_label) > 1) {
|
||||
$notrans = true;
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$labeltoshow .= $obj->$field_toshow.' ';
|
||||
}
|
||||
} else {
|
||||
$labeltoshow = $obj->{$InfoFieldList[1]};
|
||||
$sqlwhere = '';
|
||||
$sql = "SELECT " . $keyList;
|
||||
$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
|
||||
if (!empty($InfoFieldList[4])) {
|
||||
// can use SELECT request
|
||||
if (strpos($InfoFieldList[4], '$SEL$') !== false) {
|
||||
$InfoFieldList[4] = str_replace('$SEL$', 'SELECT', $InfoFieldList[4]);
|
||||
}
|
||||
$labeltoshow = dol_trunc($labeltoshow, 45);
|
||||
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
if ($translabel != $obj->$field_toshow) {
|
||||
$labeltoshow = dol_trunc($translabel, 18).' ';
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
|
||||
}
|
||||
}
|
||||
|
||||
$data[$obj->rowid] = $labeltoshow;
|
||||
// current object id can be use into filter
|
||||
if (strpos($InfoFieldList[4], '$ID$') !== false && !empty($objectid)) {
|
||||
$InfoFieldList[4] = str_replace('$ID$', $objectid, $InfoFieldList[4]);
|
||||
} else {
|
||||
if (!$notrans) {
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$labeltoshow = dol_trunc($translabel, 18);
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18);
|
||||
$InfoFieldList[4] = str_replace('$ID$', '0', $InfoFieldList[4]);
|
||||
}
|
||||
|
||||
// We have to join on extrafield table
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
$sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra';
|
||||
$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
|
||||
} else {
|
||||
$sqlwhere .= " WHERE " . $InfoFieldList[4];
|
||||
}
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE 1=1';
|
||||
}
|
||||
// Some tables may have field, some other not. For the moment we disable it.
|
||||
if (in_array($InfoFieldList[0], array('tablewithentity'))) {
|
||||
$sqlwhere .= " AND entity = " . ((int) $conf->entity);
|
||||
}
|
||||
// $sql.=preg_replace('/^ AND /','',$sqlwhere);
|
||||
// print $sql;
|
||||
|
||||
$sql .= $sqlwhere;
|
||||
dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$data = array();
|
||||
|
||||
while ($i < $num) {
|
||||
$labeltoshow = '';
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$notrans = false;
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (count($fields_label) > 1) {
|
||||
$notrans = true;
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$labeltoshow .= $obj->$field_toshow . ' ';
|
||||
}
|
||||
} else {
|
||||
$labeltoshow = $obj->{$InfoFieldList[1]};
|
||||
}
|
||||
if (empty($labeltoshow)) {
|
||||
$labeltoshow = '(not defined)';
|
||||
}
|
||||
$labeltoshow = dol_trunc($labeltoshow, 45);
|
||||
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
if ($translabel != $obj->$field_toshow) {
|
||||
$labeltoshow = dol_trunc($translabel, 18) . ' ';
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
|
||||
}
|
||||
}
|
||||
|
||||
$data[$obj->rowid] = $labeltoshow;
|
||||
} else {
|
||||
if (!$notrans) {
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$labeltoshow = dol_trunc($translabel, 18);
|
||||
} else {
|
||||
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18);
|
||||
}
|
||||
}
|
||||
if (empty($labeltoshow)) {
|
||||
$labeltoshow = '(not defined)';
|
||||
}
|
||||
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
$data[$obj->rowid] = $labeltoshow;
|
||||
}
|
||||
|
||||
if (!empty($InfoFieldList[3]) && $parentField) {
|
||||
$parent = $parentName . ':' . $obj->{$parentField};
|
||||
$isDependList = 1;
|
||||
}
|
||||
|
||||
$data[$obj->rowid] = $labeltoshow;
|
||||
}
|
||||
|
||||
if (!empty($InfoFieldList[3]) && $parentField) {
|
||||
$parent = $parentName.':'.$obj->{$parentField};
|
||||
$isDependList = 1;
|
||||
}
|
||||
|
||||
$data[$obj->rowid] = $labeltoshow;
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
$i++;
|
||||
$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
|
||||
} else {
|
||||
print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%');
|
||||
} else {
|
||||
print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
|
||||
$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, '', 0, $morecss, 0, '100%');
|
||||
}
|
||||
}
|
||||
} elseif ($type == 'link') {
|
||||
@ -7375,6 +7419,9 @@ abstract class CommonObject
|
||||
} elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) {
|
||||
$param['options'] = array($reg[1].':'.$reg[2] => 'N');
|
||||
$type = 'sellist';
|
||||
} elseif (preg_match('/^chkbxlst:(.*)/i', $val['type'], $reg)) {
|
||||
$param['options'] = array($reg[1] => 'N');
|
||||
$type = 'chkbxlst';
|
||||
}
|
||||
|
||||
$langfile = empty($val['langfile']) ? '' : $val['langfile'];
|
||||
@ -7455,6 +7502,8 @@ abstract class CommonObject
|
||||
$value = dol_print_url($value, '_blank', 32, 1);
|
||||
} elseif ($type == 'phone') {
|
||||
$value = dol_print_phone($value, '', 0, 0, '', ' ', 'phone');
|
||||
} elseif ($type == 'ip') {
|
||||
$value = dol_print_ip($value, 0);
|
||||
} elseif ($type == 'price') {
|
||||
if (!is_null($value) && $value !== '') {
|
||||
$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
|
||||
@ -7479,6 +7528,13 @@ abstract class CommonObject
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
|
||||
$filter_categorie = false;
|
||||
if (count($InfoFieldList) > 5) {
|
||||
if ($InfoFieldList[0] == 'categorie') {
|
||||
$filter_categorie = true;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT ".$keyList;
|
||||
$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
@ -7497,37 +7553,51 @@ abstract class CommonObject
|
||||
dol_syslog(get_class($this).':showOutputField:$type=sellist', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$value = ''; // value was used, so now we reste it to use it to build final output
|
||||
$numrows = $this->db->num_rows($resql);
|
||||
if ($numrows) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($filter_categorie === false) {
|
||||
$value = ''; // value was used, so now we reste it to use it to build final output
|
||||
$numrows = $this->db->num_rows($resql);
|
||||
if ($numrows) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
|
||||
if (is_array($fields_label) && count($fields_label) > 1) {
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = '';
|
||||
if (!empty($obj->$field_toshow)) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
if (is_array($fields_label) && count($fields_label) > 1) {
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = '';
|
||||
if (!empty($obj->$field_toshow)) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
}
|
||||
if ($translabel != $field_toshow) {
|
||||
$value .= dol_trunc($translabel, 18) . ' ';
|
||||
} else {
|
||||
$value .= $obj->$field_toshow . ' ';
|
||||
}
|
||||
}
|
||||
if ($translabel != $field_toshow) {
|
||||
$value .= dol_trunc($translabel, 18).' ';
|
||||
} else {
|
||||
$value .= $obj->$field_toshow.' ';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$translabel = '';
|
||||
if (!empty($obj->{$InfoFieldList[1]})) {
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
}
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$value = dol_trunc($translabel, 18);
|
||||
} else {
|
||||
$value = $obj->{$InfoFieldList[1]};
|
||||
$translabel = '';
|
||||
if (!empty($obj->{$InfoFieldList[1]})) {
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
}
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$value = dol_trunc($translabel, 18);
|
||||
} else {
|
||||
$value = $obj->{$InfoFieldList[1]};
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
|
||||
$toprint = array();
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$c = new Categorie($this->db);
|
||||
$c->fetch($obj->rowid);
|
||||
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
|
||||
}
|
||||
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
}
|
||||
} else {
|
||||
dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
|
||||
@ -7564,6 +7634,13 @@ abstract class CommonObject
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
|
||||
$filter_categorie = false;
|
||||
if (count($InfoFieldList) > 5) {
|
||||
if ($InfoFieldList[0] == 'categorie') {
|
||||
$filter_categorie = true;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT ".$keyList;
|
||||
$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
@ -7575,33 +7652,49 @@ abstract class CommonObject
|
||||
dol_syslog(get_class($this).':showOutputField:$type=chkbxlst', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$value = ''; // value was used, so now we reste it to use it to build final output
|
||||
$toprint = array();
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
if (is_array($fields_label) && count($fields_label) > 1) {
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = '';
|
||||
if (!empty($obj->$field_toshow)) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
if ($filter_categorie === false) {
|
||||
$value = ''; // value was used, so now we reste it to use it to build final output
|
||||
$toprint = array();
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
// Several field into label (eq table:code|libelle:rowid)
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
if (is_array($fields_label) && count($fields_label) > 1) {
|
||||
foreach ($fields_label as $field_toshow) {
|
||||
$translabel = '';
|
||||
if (!empty($obj->$field_toshow)) {
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
}
|
||||
if ($translabel != $field_toshow) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
|
||||
} else {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
|
||||
}
|
||||
}
|
||||
if ($translabel != $field_toshow) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
|
||||
} else {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$translabel = '';
|
||||
if (!empty($obj->{$InfoFieldList[1]})) {
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
}
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
|
||||
} else {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
|
||||
$translabel = '';
|
||||
if (!empty($obj->{$InfoFieldList[1]})) {
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
}
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
|
||||
} else {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
|
||||
$toprint = array();
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
|
||||
$c = new Categorie($this->db);
|
||||
$c->fetch($obj->rowid);
|
||||
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4913,8 +4913,8 @@ class Form
|
||||
* @param string $title Title
|
||||
* @param string $question Question
|
||||
* @param string $action Action
|
||||
* @param array|string $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>))
|
||||
* type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'select', 'multiselect', 'morecss', 'other' or 'onecolumn'...
|
||||
* @param array|string $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...'))
|
||||
* 'type' can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'select', 'multiselect', 'morecss', 'other' or 'onecolumn'...
|
||||
* @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0'
|
||||
* @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
|
||||
* @param int|string $height Force height of box (0 = auto)
|
||||
@ -9387,7 +9387,8 @@ class Form
|
||||
$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
|
||||
} else {
|
||||
if ($nophoto == 'company') {
|
||||
$ret .= '<div class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'">'.img_picto('', 'company').'</div>';
|
||||
$ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>';
|
||||
$ret .= '<div class="difforspanimgright"></div>';
|
||||
} else {
|
||||
$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
}
|
||||
|
||||
@ -165,9 +165,10 @@ class FormWebsite
|
||||
* @param int $useempty 1=Add an empty value in list
|
||||
* @param string $moreattrib More attributes on HTML select tag
|
||||
* @param int $addjscombo Add js combo
|
||||
* @param string $morecss More css
|
||||
* @return string HTML select component with list of type of containers
|
||||
*/
|
||||
public function selectSampleOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '', $addjscombo = 0)
|
||||
public function selectSampleOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '', $addjscombo = 0, $morecss = 'minwidth200')
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
|
||||
@ -190,7 +191,7 @@ class FormWebsite
|
||||
}
|
||||
|
||||
$out = '';
|
||||
$out .= '<select id="select'.$htmlname.'" class="flat selectTypeOfContainer minwidth200" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
|
||||
$out .= '<select id="select'.$htmlname.'" class="selectSampleOfContainer'.($morecss? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
|
||||
|
||||
if ($useempty == 1 || $useempty == 2) {
|
||||
$out .= '<option value="-1"> </option>';
|
||||
|
||||
@ -181,21 +181,21 @@ class Menubase
|
||||
if (!isset($this->enabled)) {
|
||||
$this->enabled = '1';
|
||||
}
|
||||
$this->menu_handler = trim($this->menu_handler);
|
||||
$this->module = trim($this->module);
|
||||
$this->type = trim($this->type);
|
||||
$this->mainmenu = trim($this->mainmenu);
|
||||
$this->leftmenu = trim($this->leftmenu);
|
||||
$this->menu_handler = trim((string) $this->menu_handler);
|
||||
$this->module = trim((string) $this->module);
|
||||
$this->type = trim((string) $this->type);
|
||||
$this->mainmenu = trim((string) $this->mainmenu);
|
||||
$this->leftmenu = trim((string) $this->leftmenu);
|
||||
$this->fk_menu = (int) $this->fk_menu; // If -1, fk_mainmenu and fk_leftmenu must be defined
|
||||
$this->fk_mainmenu = trim($this->fk_mainmenu);
|
||||
$this->fk_leftmenu = trim($this->fk_leftmenu);
|
||||
$this->fk_mainmenu = trim((string) $this->fk_mainmenu);
|
||||
$this->fk_leftmenu = trim((string) $this->fk_leftmenu);
|
||||
$this->position = (int) $this->position;
|
||||
$this->url = trim($this->url);
|
||||
$this->target = trim($this->target);
|
||||
$this->title = trim($this->title);
|
||||
$this->langs = trim($this->langs);
|
||||
$this->perms = trim($this->perms);
|
||||
$this->enabled = trim($this->enabled);
|
||||
$this->url = trim((string) $this->url);
|
||||
$this->target = trim((string) $this->target);
|
||||
$this->title = trim((string) $this->title);
|
||||
$this->langs = trim((string) $this->langs);
|
||||
$this->perms = trim((string) $this->perms);
|
||||
$this->enabled = trim((string) $this->enabled);
|
||||
$this->user = (int) $this->user;
|
||||
if (empty($this->position)) {
|
||||
$this->position = 0;
|
||||
|
||||
@ -51,6 +51,12 @@ class RssParser
|
||||
|
||||
private $current_namespace;
|
||||
|
||||
private $initem;
|
||||
private $intextinput;
|
||||
private $incontent;
|
||||
private $inimage;
|
||||
private $inchannel;
|
||||
|
||||
// For parsing with xmlparser
|
||||
public $stack = array(); // parser stack
|
||||
private $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
|
||||
@ -254,21 +260,26 @@ class RssParser
|
||||
return -1;
|
||||
}
|
||||
|
||||
$xmlparser = xml_parser_create('');
|
||||
try {
|
||||
$xmlparser = xml_parser_create(null);
|
||||
|
||||
if (!is_resource($xmlparser) && !is_object($xmlparser)) {
|
||||
$this->error = "ErrorFailedToCreateParser";
|
||||
return -1;
|
||||
if (!is_resource($xmlparser) && !is_object($xmlparser)) {
|
||||
$this->error = "ErrorFailedToCreateParser";
|
||||
return -1;
|
||||
}
|
||||
|
||||
xml_set_object($xmlparser, $this);
|
||||
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
|
||||
xml_set_character_data_handler($xmlparser, 'feed_cdata');
|
||||
|
||||
$status = xml_parse($xmlparser, $str, false);
|
||||
|
||||
xml_parser_free($xmlparser);
|
||||
$rss = $this;
|
||||
//var_dump($status.' '.$rss->_format);exit;
|
||||
} catch (Exception $e) {
|
||||
$rss = null;
|
||||
}
|
||||
|
||||
xml_set_object($xmlparser, $this);
|
||||
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
|
||||
xml_set_character_data_handler($xmlparser, 'feed_cdata');
|
||||
|
||||
$status = xml_parse($xmlparser, $str);
|
||||
xml_parser_free($xmlparser);
|
||||
$rss = $this;
|
||||
//var_dump($status.' '.$rss->_format);exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -443,7 +454,7 @@ class RssParser
|
||||
|
||||
// Loop on each category
|
||||
$itemCategory = array();
|
||||
if (is_array($item->category)) {
|
||||
if (!empty($item->category) && is_array($item->category)) {
|
||||
foreach ($item->category as $cat) {
|
||||
$itemCategory[] = (string) $cat;
|
||||
}
|
||||
@ -514,7 +525,7 @@ class RssParser
|
||||
* @param array $attrs Attributes of tags
|
||||
* @return void
|
||||
*/
|
||||
public function feed_start_element($p, $element, &$attrs)
|
||||
public function feed_start_element($p, $element, $attrs)
|
||||
{
|
||||
// phpcs:enable
|
||||
$el = $element = strtolower($element);
|
||||
@ -681,9 +692,9 @@ class RssParser
|
||||
public function append_content($text)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($this->initem) {
|
||||
if (!empty($this->initem)) {
|
||||
$this->concat($this->current_item[$this->incontent], $text);
|
||||
} elseif ($this->inchannel) {
|
||||
} elseif (!empty($this->inchannel)) {
|
||||
$this->concat($this->channel[$this->incontent], $text);
|
||||
}
|
||||
}
|
||||
@ -700,24 +711,24 @@ class RssParser
|
||||
if (!$el) {
|
||||
return;
|
||||
}
|
||||
if ($this->current_namespace) {
|
||||
if ($this->initem) {
|
||||
if (!empty($this->current_namespace)) {
|
||||
if (!empty($this->initem)) {
|
||||
$this->concat($this->current_item[$this->current_namespace][$el], $text);
|
||||
} elseif ($this->inchannel) {
|
||||
} elseif (!empty($this->inchannel)) {
|
||||
$this->concat($this->channel[$this->current_namespace][$el], $text);
|
||||
} elseif ($this->intextinput) {
|
||||
} elseif (!empty($this->intextinput)) {
|
||||
$this->concat($this->textinput[$this->current_namespace][$el], $text);
|
||||
} elseif ($this->inimage) {
|
||||
} elseif (!empty($this->inimage)) {
|
||||
$this->concat($this->image[$this->current_namespace][$el], $text);
|
||||
}
|
||||
} else {
|
||||
if ($this->initem) {
|
||||
if (!empty($this->initem)) {
|
||||
$this->concat($this->current_item[$el], $text);
|
||||
} elseif ($this->intextinput) {
|
||||
} elseif (!empty($this->intextinput)) {
|
||||
$this->concat($this->textinput[$el], $text);
|
||||
} elseif ($this->inimage) {
|
||||
} elseif (!empty($this->inimage)) {
|
||||
$this->concat($this->image[$el], $text);
|
||||
} elseif ($this->inchannel) {
|
||||
} elseif (!empty($this->inchannel)) {
|
||||
$this->concat($this->channel[$el], $text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -904,11 +904,11 @@ class Translate
|
||||
* This function need module "numberwords" to be installed. If not it will return
|
||||
* same number (this module is not provided by default as it use non GPL source code).
|
||||
*
|
||||
* @param int $number Number to encode in full text
|
||||
* @param string $isamount ''=it's just a number, '1'=It's an amount (default currency), 'currencycode'=It's an amount (foreign currency)
|
||||
* @return string Label translated in UTF8 (but without entities)
|
||||
* 10 if setDefaultLang was en_US => ten
|
||||
* 123 if setDefaultLang was fr_FR => cent vingt trois
|
||||
* @param int|string $number Number to encode in full text
|
||||
* @param string $isamount ''=it's just a number, '1'=It's an amount (default currency), 'currencycode'=It's an amount (foreign currency)
|
||||
* @return string Label translated in UTF8 (but without entities)
|
||||
* 10 if setDefaultLang was en_US => ten
|
||||
* 123 if setDefaultLang was fr_FR => cent vingt trois
|
||||
*/
|
||||
public function getLabelFromNumber($number, $isamount = '')
|
||||
{
|
||||
|
||||
@ -952,7 +952,7 @@ class Utils
|
||||
|
||||
dol_include_once('/core/lib/files.lib.php');
|
||||
|
||||
$nbSaves = empty($conf->global->SYSLOG_FILE_SAVES) ? 10 : intval($conf->global->SYSLOG_FILE_SAVES);
|
||||
$nbSaves = intval(getDolGlobalString('SYSLOG_FILE_SAVES', 10));
|
||||
|
||||
if (empty($conf->global->SYSLOG_FILE)) {
|
||||
$mainlogdir = DOL_DATA_ROOT;
|
||||
|
||||
@ -471,7 +471,7 @@ class DoliDBMysqli extends DoliDB
|
||||
*/
|
||||
public function escape($stringtoencode)
|
||||
{
|
||||
return $this->db->real_escape_string($stringtoencode);
|
||||
return $this->db->real_escape_string((string) $stringtoencode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -482,7 +482,7 @@ class DoliDBMysqli extends DoliDB
|
||||
*/
|
||||
public function escapeunderscore($stringtoencode)
|
||||
{
|
||||
return str_replace('_', '\_', $stringtoencode);
|
||||
return str_replace('_', '\_', (string) $stringtoencode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -231,33 +231,41 @@ print '
|
||||
);
|
||||
|
||||
jQuery(\'.clipboardCPValue, .clipboardCPButton, .clipboardCPValueToPrint\').click(function() {
|
||||
/* console.log(this.parentNode); */
|
||||
console.log("We click on a clipboardCPButton or clipboardCPValueToPrint class and we want to copy content of clipboardCPValue class");
|
||||
|
||||
if (window.getSelection) {
|
||||
range = document.createRange();
|
||||
|
||||
/* We select value to print using the parent. */
|
||||
/* We should use the class clipboardCPValue but it may have several element with copy/paste so class to select is not enough */
|
||||
range.selectNodeContents(this.parentNode.firstChild);
|
||||
jqobj=$(this).parent().children(".clipboardCPValue");
|
||||
console.log(jqobj.html());
|
||||
|
||||
selection = window.getSelection(); /* get the object used for selection */
|
||||
selection.removeAllRanges(); /* clear current selection */
|
||||
|
||||
/* We select the value to print using the parentNode.firstChild */
|
||||
/* We should use the class clipboardCPValue but it may have several element with copy/paste so class to select is not enough */
|
||||
range = document.createRange();
|
||||
range.selectNodeContents(this.parentNode.firstChild);
|
||||
selection.addRange(range); /* make the new selection with the value to copy */
|
||||
|
||||
/* copy selection into clipboard */
|
||||
var succeed;
|
||||
try {
|
||||
console.log("We set the style display to unset for the span so the copy will work");
|
||||
jqobj.css("display", "unset"); /* Because copy does not work on "block" object */
|
||||
|
||||
succeed = document.execCommand(\'copy\');
|
||||
|
||||
console.log("We set the style display back to inline-block");
|
||||
jqobj.css("display", "inline-block");
|
||||
} catch(e) {
|
||||
succeed = false;
|
||||
}
|
||||
|
||||
/* Remove the selection to avoid to see the hidden field to copy selected */
|
||||
window.getSelection().removeAllRanges();
|
||||
}
|
||||
|
||||
/* copy selection into clipboard */
|
||||
var succeed;
|
||||
try {
|
||||
succeed = document.execCommand(\'copy\');
|
||||
} catch(e) {
|
||||
succeed = false;
|
||||
}
|
||||
|
||||
/* Remove the selection to avoid to see the hidden field to copy selected */
|
||||
window.getSelection().removeAllRanges();
|
||||
|
||||
/* Show message */
|
||||
/* TODO Show message into a top left corner or center of screen */
|
||||
var lastchild = this.parentNode.lastChild; /* .parentNode is clipboardCP and last child is clipboardCPText */
|
||||
var tmp = lastchild.innerHTML
|
||||
if (succeed) {
|
||||
|
||||
@ -100,13 +100,22 @@ function dol_print_cron_urls()
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print $langs->trans("URLToLaunchCronJobs").':<br>';
|
||||
$url = $urlwithroot.'/public/cron/cron_run_jobs_by_url.php?'.(empty($conf->global->CRON_KEY) ? '' : 'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login;
|
||||
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.$url."</a><br>\n";
|
||||
print ' '.$langs->trans("OrToLaunchASpecificJob").'<br>';
|
||||
print '<div class="urllink">';
|
||||
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$url.'">';
|
||||
print ' <a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'globe')."</a>\n";
|
||||
print '</div>';
|
||||
print '<br> '.$langs->trans("OrToLaunchASpecificJob").'<br>';
|
||||
$url = $urlwithroot.'/public/cron/cron_run_jobs_by_url.php?'.(empty($conf->global->CRON_KEY) ? '' : 'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid';
|
||||
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.$url."</a><br>\n";
|
||||
print '<div class="urllink">';
|
||||
print '<input type="text" id="publicurlmemberall" class="quatrevingtpercentminusx" value="'.$url.'">';
|
||||
print ' <a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'globe')."</a>\n";
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
print ajax_autoselect("publicurlmember");
|
||||
print ajax_autoselect("publicurlmemberall");
|
||||
|
||||
$logintouse = 'firstadmin';
|
||||
if ($user->admin) {
|
||||
$logintouse = $user->login;
|
||||
|
||||
@ -222,7 +222,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/info.php?id='.$object->id;
|
||||
$head[$h][1] .= $langs->trans("Events");
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
$head[$h][1] .= '/';
|
||||
$head[$h][1] .= $langs->trans("Agenda");
|
||||
|
||||
@ -2196,7 +2196,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
||||
}
|
||||
|
||||
if ($showbarcode) {
|
||||
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object, 100, 'photoref').'</div>';
|
||||
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object, 100, 'photoref valignmiddle').'</div>';
|
||||
}
|
||||
|
||||
if ($object->element == 'societe') {
|
||||
@ -3948,7 +3948,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'off', 'on', 'order',
|
||||
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'puce',
|
||||
'stock', 'resize', 'service', 'stats', 'trip',
|
||||
'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
|
||||
'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'user-tie', 'vcard', 'wrench',
|
||||
'github', 'google', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
|
||||
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
|
||||
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
|
||||
@ -5001,7 +5001,7 @@ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages =
|
||||
* @param string $field Field to use for new sorting
|
||||
* @param string $begin ("" by defaut)
|
||||
* @param string $moreparam Add more parameters on sort url links ("" by default)
|
||||
* @param string $moreattrib Options of attribute td ("" by defaut, example: 'align="center"')
|
||||
* @param string $moreattrib Options of attribute td ("" by defaut)
|
||||
* @param string $sortfield Current field used to sort
|
||||
* @param string $sortorder Current sort order
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag.
|
||||
@ -5023,7 +5023,7 @@ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $m
|
||||
* @param string $field Field to use for new sorting. Empty if this field is not sortable. Example "t.abc" or "t.abc,t.def"
|
||||
* @param string $begin ("" by defaut)
|
||||
* @param string $moreparam Add more parameters on sort url links ("" by default)
|
||||
* @param string $moreattrib Add more attributes on th ("" by defaut, example: 'align="center"'). To add more css class, use param $prefix.
|
||||
* @param string $moreattrib Add more attributes on th ("" by defaut). To add more css class, use param $prefix.
|
||||
* @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id')
|
||||
* @param string $sortorder Current sort order (Ex: 'asc,desc')
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '.
|
||||
@ -6583,10 +6583,10 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
|
||||
*
|
||||
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
|
||||
* @param string $dataroot Data root directory (To avoid having the data root in the loop. Using this will also lost the warning on first dir PHP has no permission when open_basedir is used)
|
||||
* @param string|null $newmask Mask for new file (Defaults to $conf->global->MAIN_UMASK or 0755 if unavailable). Example: '0444'
|
||||
* @param string $newmask Mask for new file (Defaults to $conf->global->MAIN_UMASK or 0755 if unavailable). Example: '0444'
|
||||
* @return int < 0 if KO, 0 = already exists, > 0 if OK
|
||||
*/
|
||||
function dol_mkdir($dir, $dataroot = '', $newmask = null)
|
||||
function dol_mkdir($dir, $dataroot = '', $newmask = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -6627,7 +6627,7 @@ function dol_mkdir($dir, $dataroot = '', $newmask = null)
|
||||
dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
|
||||
|
||||
umask(0);
|
||||
$dirmaskdec = octdec($newmask);
|
||||
$dirmaskdec = octdec((string) $newmask);
|
||||
if (empty($newmask)) {
|
||||
$dirmaskdec = empty($conf->global->MAIN_UMASK) ? octdec('0755') : octdec($conf->global->MAIN_UMASK);
|
||||
}
|
||||
@ -7319,6 +7319,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
$substitutionarray['__ID__'] = '__ID__';
|
||||
$substitutionarray['__REF__'] = '__REF__';
|
||||
$substitutionarray['__NEWREF__'] = '__NEWREF__';
|
||||
$substitutionarray['__LABEL__'] = '__LABEL__';
|
||||
$substitutionarray['__REF_CLIENT__'] = '__REF_CLIENT__';
|
||||
$substitutionarray['__REF_SUPPLIER__'] = '__REF_SUPPLIER__';
|
||||
$substitutionarray['__NOTE_PUBLIC__'] = '__NOTE_PUBLIC__';
|
||||
@ -7413,6 +7414,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
$substitutionarray['__ID__'] = $object->id;
|
||||
$substitutionarray['__REF__'] = $object->ref;
|
||||
$substitutionarray['__NEWREF__'] = $object->newref;
|
||||
$substitutionarray['__LABEL__'] = (isset($object->label) ? $object->label : (isset($object->title) ? $object->title : null));
|
||||
$substitutionarray['__REF_CLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
|
||||
$substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
|
||||
$substitutionarray['__NOTE_PUBLIC__'] = (isset($object->note_public) ? $object->note_public : null);
|
||||
@ -7461,8 +7463,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
$substitutionarray['__MEMBER_PHONEMOBILE__'] = (isset($object->phone_mobile) ? dol_print_phone($object->phone_mobile) : '');
|
||||
$substitutionarray['__MEMBER_TYPE__'] = (isset($object->type) ? $object->type : '');
|
||||
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE__'] = dol_print_date($object->first_subscription_date, 'dayrfc');
|
||||
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_START__'] = dol_print_date($object->first_subscription_date_start, 'dayrfc');
|
||||
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_END__'] = dol_print_date($object->first_subscription_date_end, 'dayrfc');
|
||||
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_START__'] = (isset($object->first_subscription_date_start) ? dol_print_date($object->first_subscription_date_start, 'dayrfc') : '');
|
||||
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_END__'] = (isset($object->first_subscription_date_end) ? dol_print_date($object->first_subscription_date_end, 'dayrfc') : '');
|
||||
$substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE__'] = dol_print_date($object->last_subscription_date, 'dayrfc');
|
||||
$substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE_START__'] = dol_print_date($object->last_subscription_date_start, 'dayrfc');
|
||||
$substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE_END__'] = dol_print_date($object->last_subscription_date_end, 'dayrfc');
|
||||
@ -8215,7 +8217,6 @@ function get_htmloutput_mesg($mesgstring = '', $mesgarray = '', $style = 'ok', $
|
||||
}
|
||||
}
|
||||
if ($mesgstring) {
|
||||
$langs->load("errors");
|
||||
$ret++;
|
||||
$out .= $langs->trans($mesgstring);
|
||||
}
|
||||
@ -8599,7 +8600,8 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
||||
if ($onlysimplestring == '1') {
|
||||
// We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL'
|
||||
// We must accept: '$conf->barcode->enabled && preg_match(\'/^(AAA|BBB)/\',$leftmenu)'
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/', '/').']/i', $s)) {
|
||||
// We must accept: '$user->rights->cabinetmed->read && $object->canvas=="patient@cabinetmed"'
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||
} else {
|
||||
@ -8611,7 +8613,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
||||
}
|
||||
} elseif ($onlysimplestring == '2') {
|
||||
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/;[]', '/').']/i', $s)) {
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@;[]', '/').']/i', $s)) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||
} else {
|
||||
@ -11043,12 +11045,12 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a button to copy $valuetocopy in the clipboard.
|
||||
* Code that handle the click is inside lib_foot.jsp.php.
|
||||
* Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
|
||||
* Code that handle the click is inside core/js/lib_foot.js.php.
|
||||
*
|
||||
* @param string $valuetocopy The value to print
|
||||
* @param int $showonlyonhover Show the copy-paste button only on hover
|
||||
* @param string $texttoshow Replace the value to show with this text
|
||||
* @param string $texttoshow Replace the value to show with this text. Use 'none' to show no text (only the copy-paste picto)
|
||||
* @return string The string to print for the button
|
||||
*/
|
||||
function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $texttoshow = '')
|
||||
@ -11060,8 +11062,10 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex
|
||||
$showonlyonhover = 0;
|
||||
}*/
|
||||
|
||||
$tag = 'span'; // Using div does not work when using the js copy code.
|
||||
if ($texttoshow) {
|
||||
$tag = 'span'; // Using div (like any style of type 'block') does not work when using the js copy code.
|
||||
if ($texttoshow === 'none') {
|
||||
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPValueToPrint"></span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText"></span></span>';
|
||||
} elseif ($texttoshow) {
|
||||
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPValueToPrint">'.dol_escape_htmltag($texttoshow, 1, 1).'</span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText"></span></span>';
|
||||
} else {
|
||||
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText"></span></span>';
|
||||
|
||||
@ -824,10 +824,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
}
|
||||
|
||||
// Budget task
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.budget_amount']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
|
||||
$total_budget_amount += $lines[$i]->budget_amount;
|
||||
if ($lines[$i]->budget_amount) {
|
||||
print '<span class="amount">'.price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).'</span>';
|
||||
$total_budget_amount += $lines[$i]->budget_amount;
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -982,7 +985,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
|
||||
|
||||
// resume
|
||||
// Progress
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.progress_summary']['checked'])) {
|
||||
print '<td class="right">';
|
||||
if ($total_projectlinesa_planned) {
|
||||
@ -1008,9 +1011,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
}
|
||||
|
||||
// Budget task
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.budget_amount']['checked'])) {
|
||||
print '<td class="nowrap liste_total center">';
|
||||
print price($total_budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
|
||||
if (strcmp($total_budget_amount, '')) {
|
||||
print price($total_budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -2240,7 +2240,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
|
||||
$newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer);
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire);
|
||||
|
||||
$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"'));
|
||||
$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="pictofixedwidth"'));
|
||||
|
||||
// Skills
|
||||
$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Skills"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="pictofixedwidth"'));
|
||||
|
||||
@ -78,7 +78,7 @@ class mod_asset_advanced extends ModeleNumRefAsset
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskAsset" value="'.$conf->global->ASSET_ASSET_ADVANCED_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskAsset" value="'.getDolGlobalString('ASSET_ASSET_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
|
||||
@ -131,7 +131,7 @@ class mod_asset_advanced extends ModeleNumRefAsset
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = $conf->global->ASSET_ASSET_ADVANCED_MASK;
|
||||
$mask = getDolGlobalString('ASSET_ASSET_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
|
||||
@ -79,7 +79,7 @@ class mod_bom_advanced extends ModeleNumRefboms
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskBom" value="'.$conf->global->BOM_ADVANCED_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskBom" value="'.getDolGlobalString('BOM_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
|
||||
@ -128,7 +128,7 @@ class mod_bom_advanced extends ModeleNumRefboms
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = $conf->global->BOM_ADVANCED_MASK;
|
||||
$mask = getDolGlobalString('BOM_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
|
||||
@ -79,9 +79,9 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskEvaluation" value="'.$conf->global->HRM_EVALUATION_ADVANCED_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskEvaluation" value="'.getDolGlobalString('HRM_EVALUATION_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||
|
||||
$texte .= '</tr>';
|
||||
|
||||
@ -132,7 +132,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = $conf->global->HRM_EVALUATION_ADVANCED_MASK;
|
||||
$mask = getDolGlobalString('HRM_EVALUATION_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
|
||||
@ -125,7 +125,7 @@ class doc_generic_member_odt extends ModelePDFMember
|
||||
// List of directories area
|
||||
$texte .= '<tr><td>';
|
||||
$texttitle = $langs->trans("ListOfDirectories");
|
||||
$listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->MEMBER_ADDON_PDF_ODT_PATH)));
|
||||
$listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString('MEMBER_ADDON_PDF_ODT_PATH'))));
|
||||
$listoffiles = array();
|
||||
foreach ($listofdir as $key => $tmpdir) {
|
||||
$tmpdir = trim($tmpdir);
|
||||
@ -151,7 +151,7 @@ class doc_generic_member_odt extends ModelePDFMember
|
||||
$texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1);
|
||||
$texte .= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
|
||||
$texte .= '<textarea class="flat" cols="60" name="value1">';
|
||||
$texte .= $conf->global->MEMBER_ADDON_PDF_ODT_PATH;
|
||||
$texte .= getDolGlobalString('MEMBER_ADDON_PDF_ODT_PATH');
|
||||
$texte .= '</textarea>';
|
||||
$texte .= '</div><div style="display: inline-block; vertical-align: middle;">';
|
||||
$texte .= '<input type="submit" class="button small reposition" name="modify" value="'.$langs->trans("Modify").'">';
|
||||
|
||||
@ -173,7 +173,7 @@ class pdf_standard extends CommonStickerGenerator
|
||||
$widthtouse = $maxwidthtouse;
|
||||
$heighttouse = 0; // old value for image
|
||||
$tmp = dol_getImageSize($photo, false);
|
||||
if ($tmp['height']) {
|
||||
if (isset($tmp['height'])) {
|
||||
$imgratio = $tmp['width'] / $tmp['height'];
|
||||
if ($imgratio >= $defaultratio) {
|
||||
$widthtouse = $maxwidthtouse;
|
||||
@ -314,10 +314,10 @@ class pdf_standard extends CommonStickerGenerator
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
// For business cards
|
||||
$textleft = make_substitutions($conf->global->ADHERENT_CARD_TEXT, $substitutionarray);
|
||||
$textheader = make_substitutions($conf->global->ADHERENT_CARD_HEADER_TEXT, $substitutionarray);
|
||||
$textfooter = make_substitutions($conf->global->ADHERENT_CARD_FOOTER_TEXT, $substitutionarray);
|
||||
$textright = make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray);
|
||||
$textleft = make_substitutions(getDolGlobalString("ADHERENT_CARD_TEXT"), $substitutionarray);
|
||||
$textheader = make_substitutions(getDolGlobalString("ADHERENT_CARD_HEADER_TEXT"), $substitutionarray);
|
||||
$textfooter = make_substitutions(getDolGlobalString("ADHERENT_CARD_FOOTER_TEXT"), $substitutionarray);
|
||||
$textright = make_substitutions(getDolGlobalString("ADHERENT_CARD_TEXT_RIGHT"), $substitutionarray);
|
||||
|
||||
$nb = $_Avery_Labels[$this->code]['NX'] * $_Avery_Labels[$this->code]['NY'];
|
||||
if ($nb <= 0) {
|
||||
@ -330,8 +330,8 @@ class pdf_standard extends CommonStickerGenerator
|
||||
'textheader'=>$textheader,
|
||||
'textfooter'=>$textfooter,
|
||||
'textright'=>$textright,
|
||||
'id'=>$object->rowid,
|
||||
'photo'=>$object->photo
|
||||
'id'=>(isset($object->rowid) ? $object->rowid : ""),
|
||||
'photo'=>(isset($object->photo) ? $object->photo : "")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -93,7 +93,8 @@ class modIncoterm extends DolibarrModules
|
||||
'tabfieldvalue'=>array("code,libelle"), // List of fields (list of fields to edit a record)
|
||||
'tabfieldinsert'=>array("code,libelle"), // List of fields (list of fields for insert)
|
||||
'tabrowid'=>array("rowid"), // Name of columns with primary key (try to always name it 'rowid')
|
||||
'tabcond'=>array($conf->incoterm->enabled)
|
||||
'tabcond'=>array($conf->incoterm->enabled),
|
||||
'tabhelp' => array(array())
|
||||
);
|
||||
|
||||
$this->boxes = array(); // List of boxes
|
||||
|
||||
@ -80,7 +80,7 @@ class mod_mo_advanced extends ModeleNumRefMos
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskMo" value="'.$conf->global->MRP_MO_ADVANCED_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskMo" value="'.getDolGlobalString('MRP_MO_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
|
||||
@ -129,7 +129,7 @@ class mod_mo_advanced extends ModeleNumRefMos
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = $conf->global->MRP_MO_ADVANCED_MASK;
|
||||
$mask = getDolGlobalString('MRP_MO_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
|
||||
@ -67,7 +67,11 @@ class PrintingDriver
|
||||
$list = array();
|
||||
|
||||
$listoffiles = array();
|
||||
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
||||
if (!empty($conf->modules_parts['printing'])) {
|
||||
$dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']);
|
||||
} else {
|
||||
$dirmodels = array('/core/modules/printing/');
|
||||
}
|
||||
foreach ($dirmodels as $dir) {
|
||||
$tmpfiles = dol_dir_list(dol_buildpath($dir, 0), 'all', 0, '\.modules.php', '', 'name', SORT_ASC, 0);
|
||||
if (!empty($tmpfiles)) {
|
||||
|
||||
@ -116,8 +116,8 @@ class printing_printgcp extends PrintingDriver
|
||||
'type'=>'info',
|
||||
);
|
||||
} else {
|
||||
$this->google_id = $conf->global->OAUTH_GOOGLE_ID;
|
||||
$this->google_secret = $conf->global->OAUTH_GOOGLE_SECRET;
|
||||
$this->google_id = getDolGlobalString('OAUTH_GOOGLE_ID');
|
||||
$this->google_secret = getDolGlobalString('OAUTH_GOOGLE_SECRET');
|
||||
// Token storage
|
||||
$storage = new DoliStorage($this->db, $this->conf);
|
||||
//$storage->clearToken($this->OAUTH_SERVICENAME_GOOGLE);
|
||||
|
||||
@ -66,7 +66,7 @@ class mod_lot_advanced extends ModeleNumRefBatch
|
||||
$form = new Form($db);
|
||||
|
||||
// We get cursor rule
|
||||
$mask = isset($conf->global->LOT_ADVANCED_MASK) ? $conf->global->LOT_ADVANCED_MASK : '';
|
||||
$mask = getDolGlobalString('LOT_ADVANCED_MASK');
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
@ -142,7 +142,7 @@ class mod_lot_advanced extends ModeleNumRefBatch
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = isset($conf->global->LOT_ADVANCED_MASK) ? $conf->global->LOT_ADVANCED_MASK : '';
|
||||
$mask = getDolGlobalString('LOT_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
|
||||
@ -66,7 +66,7 @@ class mod_sn_advanced extends ModeleNumRefBatch
|
||||
$form = new Form($db);
|
||||
|
||||
// We get cursor rule
|
||||
$mask = isset($conf->global->SN_ADVANCED_MASK) ? $conf->global->SN_ADVANCED_MASK : '';
|
||||
$mask = getDolGlobalString('SN_ADVANCED_MASK');
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
@ -142,7 +142,7 @@ class mod_sn_advanced extends ModeleNumRefBatch
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = isset($conf->global->SN_ADVANCED_MASK) ? $conf->global->SN_ADVANCED_MASK : '';
|
||||
$mask = getDolGlobalString('SN_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
|
||||
@ -80,7 +80,7 @@ class mod_stocktransfer_advanced extends ModeleNumRefStockTransfer
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskStockTransfer" value="'.$conf->global->STOCKTRANSFER_STOCKTRANSFER_ADVANCED_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskStockTransfer" value="'.getDolGlobalString('STOCKTRANSFER_STOCKTRANSFER_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||
|
||||
@ -133,7 +133,7 @@ class mod_stocktransfer_advanced extends ModeleNumRefStockTransfer
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = $conf->global->STOCKTRANSFER_STOCKTRANSFER_ADVANCED_MASK;
|
||||
$mask = getDolGlobalString('STOCKTRANSFER_STOCKTRANSFER_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
|
||||
@ -80,7 +80,7 @@ class mod_workstation_advanced extends ModeleNumRefWorkstation
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskWorkstation" value="'.$conf->global->WORKSTATION_WORKSTATION_ADVANCED_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskWorkstation" value="'.getDolGlobalString('WORKSTATION_WORKSTATION_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
|
||||
@ -133,7 +133,7 @@ class mod_workstation_advanced extends ModeleNumRefWorkstation
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = $conf->global->WORKSTATION_WORKSTATION_ADVANCED_MASK;
|
||||
$mask = getDolGlobalString('WORKSTATION_WORKSTATION_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
|
||||
@ -38,7 +38,7 @@ $langs->load("modulebuilder");
|
||||
<!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
|
||||
<?php
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("DefineHereComplementaryAttributes", $textobject).'</span><br>'."\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("DefineHereComplementaryAttributes", empty($textobject) ? '': $textobject).'</span><br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
// Load $extrafields->attributes
|
||||
|
||||
@ -68,6 +68,9 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
|
||||
$totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
|
||||
}
|
||||
if (is_numeric($obj->$tmpkey)) {
|
||||
if (!isset($totalarray['totalizable'][$key]['total'])) {
|
||||
$totalarray['totalizable'][$key]['total'] = 0;
|
||||
}
|
||||
$totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
|
||||
}
|
||||
}
|
||||
|
||||
@ -487,9 +487,9 @@ class Cronjob extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
* Load list of cron jobs in a memory array from the database
|
||||
* @TODO Use object CronJob and not CronJobLine.
|
||||
*
|
||||
* @param string $sortorder sort order
|
||||
* @param string $sortfield sort field
|
||||
@ -500,11 +500,8 @@ class Cronjob extends CommonObject
|
||||
* @param int $processing Processing or not
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch_all($sortorder = 'DESC', $sortfield = 't.rowid', $limit = 0, $offset = 0, $status = 1, $filter = '', $processing = -1)
|
||||
public function fetchAll($sortorder = 'DESC', $sortfield = 't.rowid', $limit = 0, $offset = 0, $status = 1, $filter = '', $processing = -1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$this->lines = array();
|
||||
|
||||
$sql = "SELECT";
|
||||
@ -1471,6 +1468,8 @@ class Cronjobline
|
||||
*/
|
||||
public $id;
|
||||
|
||||
public $entity;
|
||||
|
||||
/**
|
||||
* @var string Ref
|
||||
*/
|
||||
|
||||
@ -263,7 +263,7 @@ if (empty($reshook)) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer) && empty($user->rights->expensereport->writeall_advance))) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
|
||||
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors');
|
||||
}
|
||||
if (!$error) {
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) {
|
||||
|
||||
@ -129,6 +129,10 @@ class ExpenseReport extends CommonObject
|
||||
public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject)
|
||||
public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject)
|
||||
|
||||
public $statuts = array();
|
||||
public $statuts_short = array();
|
||||
public $statuts_logo;
|
||||
|
||||
|
||||
/**
|
||||
* Draft status
|
||||
|
||||
@ -482,7 +482,7 @@ if ($resql) {
|
||||
if ($canedit) {
|
||||
print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$fuser->id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
|
||||
} else {
|
||||
print '<a href="#" class="butActionRefused" title="'.$langs->trans("NotEnoughPermission").'">'.$langs->trans("AddTrip").'</a>';
|
||||
print '<a href="#" class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddTrip").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -1432,7 +1432,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
$this->special_code = $line->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
||||
//$this->special_code = $line->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
||||
|
||||
// This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
||||
$result = $this->addline(
|
||||
@ -1454,7 +1454,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
$line->date_start,
|
||||
$line->date_end,
|
||||
$line->array_options,
|
||||
$line->fk_unit
|
||||
$line->fk_unit,
|
||||
$line->special_code
|
||||
);
|
||||
if ($result < 0) {
|
||||
dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error
|
||||
@ -1745,9 +1746,10 @@ class CommandeFournisseur extends CommonOrder
|
||||
* @param string $origin 'order', ...
|
||||
* @param int $origin_id Id of origin object
|
||||
* @param int $rang Rank
|
||||
* @param int $special_code Special code
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $fk_prod_fourn_price = 0, $ref_supplier = '', $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $type = 0, $info_bits = 0, $notrigger = false, $date_start = null, $date_end = null, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $origin = '', $origin_id = 0, $rang = -1)
|
||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $fk_prod_fourn_price = 0, $ref_supplier = '', $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $type = 0, $info_bits = 0, $notrigger = false, $date_start = null, $date_end = null, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $origin = '', $origin_id = 0, $rang = -1, $special_code = 0)
|
||||
{
|
||||
global $langs, $mysoc, $conf;
|
||||
|
||||
@ -1871,7 +1873,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
// Predefine quantity according to packaging
|
||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||
$prod = new Product($this->db, $fk_product);
|
||||
$prod = new Product($this->db);
|
||||
$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc ? $this->fk_soc : $this->socid));
|
||||
|
||||
if ($qty < $prod->packaging) {
|
||||
@ -1880,9 +1882,9 @@ class CommandeFournisseur extends CommonOrder
|
||||
if (!empty($prod->packaging) && ($qty % $prod->packaging) > 0) {
|
||||
$coeff = intval($qty / $prod->packaging) + 1;
|
||||
$qty = $prod->packaging * $coeff;
|
||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||
}
|
||||
}
|
||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
@ -1957,7 +1959,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->line->total_localtax2 = $total_localtax2;
|
||||
$this->line->total_ttc = $total_ttc;
|
||||
$this->line->product_type = $type;
|
||||
$this->line->special_code = $this->special_code;
|
||||
$this->line->special_code = $special_code;
|
||||
$this->line->origin = $origin;
|
||||
$this->line->origin_id = $origin_id;
|
||||
$this->line->fk_unit = $fk_unit;
|
||||
|
||||
@ -2074,7 +2074,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
if (!empty($conf->global->SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY)) {
|
||||
// Check quantity is enough
|
||||
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." qty=".$qty." ref_supplier=".$ref_supplier);
|
||||
$prod = new Product($this->db, $fk_product);
|
||||
$prod = new Product($this->db);
|
||||
if ($prod->fetch($fk_product) > 0) {
|
||||
$product_type = $prod->type;
|
||||
$label = $prod->label;
|
||||
|
||||
@ -555,13 +555,15 @@ if (empty($reshook)) {
|
||||
$ref_supplier = $productsupplier->ref_supplier;
|
||||
|
||||
// Get vat rate
|
||||
$tva_npr = 0;
|
||||
if (!GETPOSTISSET('tva_tx')) { // If vat rate not provided from the form (the form has the priority)
|
||||
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha'));
|
||||
$tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha'));
|
||||
if (empty($tva_tx)) {
|
||||
$tva_npr = 0;
|
||||
}
|
||||
}
|
||||
if (empty($tva_tx)) {
|
||||
$tva_npr = 0;
|
||||
}
|
||||
|
||||
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr);
|
||||
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr);
|
||||
|
||||
@ -597,7 +599,7 @@ if (empty($reshook)) {
|
||||
$localtax1_tx,
|
||||
$localtax2_tx,
|
||||
$idprod,
|
||||
0, // We already have the $idprod always defined
|
||||
$productsupplier->product_fourn_price_id,
|
||||
$ref_supplier,
|
||||
$remise_percent,
|
||||
$price_base_type,
|
||||
@ -667,10 +669,10 @@ if (empty($reshook)) {
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
||||
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
||||
$newlang = GETPOST('lang_id', 'aZ09');
|
||||
}
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
|
||||
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
}
|
||||
if (!empty($newlang)) {
|
||||
@ -2681,7 +2683,7 @@ if ($action == 'create') {
|
||||
$delallowed = $usercancreate;
|
||||
$modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF) ? '' : $conf->global->COMMANDE_SUPPLIER_ADDON_PDF));
|
||||
|
||||
print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang);
|
||||
print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang, '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
// Show links to link elements
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -27,17 +27,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$langs->loadLangs(array("admin", "other"));
|
||||
|
||||
// Security check
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$def = array();
|
||||
$lastftpentry = 0;
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$entry = GETPOST('numero_entry', 'alpha');
|
||||
|
||||
// Security check
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
@ -49,8 +49,9 @@ $sql .= " WHERE name like 'FTP_SERVER_%'";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object($result);
|
||||
$reg = array();
|
||||
preg_match('/([0-9]+)$/i', $obj->name, $reg);
|
||||
if ($reg[1]) {
|
||||
if (!empty($reg[1])) {
|
||||
$lastftpentry = $reg[1];
|
||||
}
|
||||
} else {
|
||||
@ -63,12 +64,12 @@ if ($action == 'add' || GETPOST('modify', 'alpha')) {
|
||||
|
||||
$error = 0;
|
||||
|
||||
if (!GETPOST("$ftp_name", 'alpha')) {
|
||||
if (!GETPOST($ftp_name, 'alpha')) {
|
||||
$error = 1;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
||||
}
|
||||
|
||||
if (!GETPOST("$ftp_server", 'alpha')) {
|
||||
if (!GETPOST($ftp_server, 'alpha')) {
|
||||
$error = 1;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Server")), null, 'errors');
|
||||
}
|
||||
@ -170,37 +171,37 @@ if (!function_exists('ftp_connect')) {
|
||||
print '<td>'.$langs->trans("Example").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="pair">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td><input type="text" name="FTP_NAME_'.($lastftpentry + 1).'" value="'.GETPOST("FTP_NAME_".($lastftpentry + 1)).'" size="64"></td>';
|
||||
print '<td>My FTP access</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="impair">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("Server").'</td>';
|
||||
print '<td><input type="text" name="FTP_SERVER_'.($lastftpentry + 1).'" value="'.GETPOST("FTP_SERVER_".($lastftpentry + 1)).'" size="64"></td>';
|
||||
print '<td>localhost</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="pair">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="100">'.$langs->trans("Port").'</td>';
|
||||
print '<td><input type="text" name="FTP_PORT_'.($lastftpentry + 1).'" value="'.GETPOST("FTP_PORT_".($lastftpentry + 1)).'" size="64"></td>';
|
||||
print '<td>21 for pure non crypted FTP or if option FTP_CONNECT_WITH_SSL (See Home-Setup-Other) is on (FTPS)<br>22 if option FTP_CONNECT_WITH_SFTP (See Home-Setup-Other) is on (SFTP)</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="impair">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("User").'</td>';
|
||||
print '<td><input type="text" name="FTP_USER_'.($lastftpentry + 1).'" value="'.GETPOST("FTP_USER_".($lastftpentry + 1)).'" class="minwidth175"></td>';
|
||||
print '<td>myftplogin</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="pair">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("Password").'</td>';
|
||||
print '<td><input type="password" name="FTP_PASSWORD_'.($lastftpentry + 1).'" value="'.GETPOST("FTP_PASSWORD_".($lastftpentry + 1)).'" class="minwidth175"></td>';
|
||||
print '<td>myftppassword</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="impair">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("FTPPassiveMode").'</td>';
|
||||
$defaultpassive = GETPOST("FTP_PASSIVE_".($lastftpentry + 1));
|
||||
if (!GETPOSTISSET("FTP_PASSIVE_".($lastftpentry + 1))) {
|
||||
@ -213,11 +214,13 @@ if (!function_exists('ftp_connect')) {
|
||||
print '</table>';
|
||||
|
||||
?>
|
||||
<br><div class="center"><input type="submit" class="button" value="<?php echo $langs->trans("Add") ?>"></div>
|
||||
<div class="center">
|
||||
<input type="submit" class="button" value="<?php echo $langs->trans("Add") ?>"></div>
|
||||
<input type="hidden" name="action" value="add">
|
||||
<input type="hidden" name="numero_entry" value="<?php echo ($lastftpentry + 1) ?>">
|
||||
<?php
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
?>
|
||||
|
||||
<br>
|
||||
@ -242,10 +245,12 @@ if (!function_exists('ftp_connect')) {
|
||||
$idrss = $reg[0];
|
||||
//print "x".join(',',$reg)."=".$obj->name."=".$idrss;
|
||||
|
||||
print "<form name=\"externalrssconfig\" action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">";
|
||||
print '<br>';
|
||||
print '<form name="externalrssconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="numero_entry" value="'.$idrss.'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -262,51 +267,50 @@ if (!function_exists('ftp_connect')) {
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>".$langs->trans("Name")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"FTP_NAME_".$idrss."\" value=\"".$conf->global->$keyforname."\" size=\"64\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"FTP_NAME_".$idrss."\" value=\"".getDolGlobalString($keyforname)."\" size=\"64\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>".$langs->trans("Server")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"FTP_SERVER_".$idrss."\" value=\"".$conf->global->$keyforserver."\" size=\"64\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"FTP_SERVER_".$idrss."\" value=\"".getDolGlobalString($keyforserver)."\" size=\"64\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td width=\"100\">".$langs->trans("Port")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"FTP_PORT_".$idrss."\" value=\"".$conf->global->$keyforport."\" size=\"64\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"FTP_PORT_".$idrss."\" value=\"".getDolGlobalString($keyforport)."\" size=\"64\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td width=\"100\">".$langs->trans("User")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"FTP_USER_".$idrss."\" value=\"".$conf->global->$keyforuser."\" size=\"24\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"FTP_USER_".$idrss."\" value=\"".getDolGlobalString($keyforuser)."\" size=\"24\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td width=\"100\">".$langs->trans("Password")."</td>";
|
||||
print "<td><input type=\"password\" class=\"flat\" name=\"FTP_PASSWORD_".$idrss."\" value=\"".$conf->global->$keyforpassword."\" size=\"24\"></td>";
|
||||
print "<td><input type=\"password\" class=\"flat\" name=\"FTP_PASSWORD_".$idrss."\" value=\"".getDolGlobalString($keyforpassword)."\" size=\"24\"></td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td width=\"100\">".$langs->trans("FTPPassiveMode")."</td>";
|
||||
print '<td>'.$form->selectyesno('FTP_PASSIVE_'.$idrss, $conf->global->$keyforpassive, 1).'</td>';
|
||||
print "</tr>";
|
||||
|
||||
print "<tr>";
|
||||
print "<td colspan=\"2\" class=\"center\">";
|
||||
print "<input type=\"submit\" class=\"button\" name=\"modify\" value=\"".$langs->trans("Modify")."\">";
|
||||
print " ";
|
||||
print "<input type=\"submit\" class=\"button\" name=\"delete\" value=\"".$langs->trans("Delete")."\">";
|
||||
print "</td>";
|
||||
print '<td>'.$form->selectyesno('FTP_PASSIVE_'.$idrss, getDolGlobalString($keyforpassive), 1).'</td>';
|
||||
print "</tr>";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">';
|
||||
print " ";
|
||||
print '<input type="submit" class="button" name="delete" value="'.$langs->trans("Delete").'">';
|
||||
print '</center>';
|
||||
|
||||
print "</form>";
|
||||
print '<br>';
|
||||
print '<br><br>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -74,14 +74,15 @@ $s_ftp_port = 'FTP_PORT_'.$numero_ftp;
|
||||
$s_ftp_user = 'FTP_USER_'.$numero_ftp;
|
||||
$s_ftp_password = 'FTP_PASSWORD_'.$numero_ftp;
|
||||
$s_ftp_passive = 'FTP_PASSIVE_'.$numero_ftp;
|
||||
$ftp_name = $conf->global->$s_ftp_name;
|
||||
$ftp_server = $conf->global->$s_ftp_server;
|
||||
$ftp_port = $conf->global->$s_ftp_port; if (empty($ftp_port)) {
|
||||
$ftp_name = getDolGlobalString($s_ftp_name);
|
||||
$ftp_server = getDolGlobalString($s_ftp_server);
|
||||
$ftp_port = getDolGlobalString($s_ftp_port);
|
||||
if (empty($ftp_port)) {
|
||||
$ftp_port = 21;
|
||||
}
|
||||
$ftp_user = $conf->global->$s_ftp_user;
|
||||
$ftp_password = $conf->global->$s_ftp_password;
|
||||
$ftp_passive = $conf->global->$s_ftp_passive;
|
||||
$ftp_user = getDolGlobalString($s_ftp_user);
|
||||
$ftp_password = getDolGlobalString($s_ftp_password);
|
||||
$ftp_passive = getDolGlobalString($s_ftp_passive);
|
||||
|
||||
// For result on connection
|
||||
$ok = 0;
|
||||
@ -696,7 +697,9 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
|
||||
global $langs, $conf;
|
||||
|
||||
$ok = 1;
|
||||
$error = 0;
|
||||
$conn_id = null;
|
||||
$newsectioniso = '';
|
||||
$mesg="";
|
||||
|
||||
if (!is_numeric($ftp_port)) {
|
||||
@ -707,7 +710,7 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
|
||||
if ($ok) {
|
||||
$connecttimeout = (empty($conf->global->FTP_CONNECT_TIMEOUT) ? 40 : $conf->global->FTP_CONNECT_TIMEOUT);
|
||||
if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) {
|
||||
dol_syslog('Try to connect with ssh2_ftp');
|
||||
dol_syslog('Try to connect with ssh2_connect');
|
||||
$tmp_conn_id = ssh2_connect($ftp_server, $ftp_port);
|
||||
} elseif (!empty($conf->global->FTP_CONNECT_WITH_SSL)) {
|
||||
dol_syslog('Try to connect with ftp_ssl_connect');
|
||||
@ -716,7 +719,7 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
|
||||
dol_syslog('Try to connect with ftp_connect');
|
||||
$conn_id = ftp_connect($ftp_server, $ftp_port, $connecttimeout);
|
||||
}
|
||||
if ($conn_id || $tmp_conn_id) {
|
||||
if (!empty($conn_id) || !empty($tmp_conn_id)) {
|
||||
if ($ftp_user) {
|
||||
if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) {
|
||||
dol_syslog('Try to authenticate with ssh2_auth_password');
|
||||
|
||||
@ -910,7 +910,7 @@ $edit = false;
|
||||
|
||||
if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
// If user has no permission to create a leave
|
||||
if ((in_array($fuserid, $childids) && empty($user->rights->holiday->write)) || (!in_array($fuserid, $childids) && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance)))) {
|
||||
if ((in_array($fuserid, $childids) && empty($user->rights->holiday->write)) || (!in_array($fuserid, $childids) && ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->holiday->writeall_advance) || empty($user->rights->holiday->writeall))))) {
|
||||
$errors[] = $langs->trans('CantCreateCP');
|
||||
} else {
|
||||
// Form to add a leave request
|
||||
@ -923,7 +923,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
$errors[] = $langs->trans('ErrorEndDateCP');
|
||||
break;
|
||||
case 'SQL_Create':
|
||||
$errors[] = $langs->trans('ErrorSQLCreateCP').' <b>'.htmlentities($_GET['msg']).'</b>';
|
||||
$errors[] = $langs->trans('ErrorSQLCreateCP');
|
||||
break;
|
||||
case 'CantCreate':
|
||||
$errors[] = $langs->trans('CantCreateCP');
|
||||
@ -1153,7 +1153,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
$errors[] = $langs->transnoentitiesnoconv('ErrorEndDateCP');
|
||||
break;
|
||||
case 'SQL_Create':
|
||||
$errors[] = $langs->transnoentitiesnoconv('ErrorSQLCreateCP').' '.$_GET['msg'];
|
||||
$errors[] = $langs->transnoentitiesnoconv('ErrorSQLCreateCP');
|
||||
break;
|
||||
case 'CantCreate':
|
||||
$errors[] = $langs->transnoentitiesnoconv('CantCreateCP');
|
||||
@ -1174,7 +1174,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
$errors[] = $langs->transnoentitiesnoconv('NoMotifRefuseCP');
|
||||
break;
|
||||
case 'mail':
|
||||
$errors[] = $langs->transnoentitiesnoconv('ErrorMailNotSend')."\n".$_GET['error_content'];
|
||||
$errors[] = $langs->transnoentitiesnoconv('ErrorMailNotSend');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -385,7 +385,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
$errors[] = $langs->trans('ErrorEndDateCP');
|
||||
break;
|
||||
case 'SQL_Create':
|
||||
$errors[] = $langs->trans('ErrorSQLCreateCP').' <b>'.htmlentities($_GET['msg']).'</b>';
|
||||
$errors[] = $langs->trans('ErrorSQLCreateCP');
|
||||
break;
|
||||
case 'CantCreate':
|
||||
$errors[] = $langs->trans('CantCreateCP');
|
||||
|
||||
@ -1442,7 +1442,7 @@ class Holiday extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return value of a conf parameterfor leave module
|
||||
* Return value of a conf parameter for leave module
|
||||
* TODO Move this into llx_const table
|
||||
*
|
||||
* @param string $name Name of parameter
|
||||
|
||||
@ -76,7 +76,7 @@ class Skill extends CommonObject
|
||||
const STATUS_DRAFT = 0;
|
||||
const STATUS_VALIDATED = 1;
|
||||
const STATUS_CANCELED = 9;
|
||||
const DEFAULT_MAX_RANK_PER_SKILL = 5;
|
||||
const DEFAULT_MAX_RANK_PER_SKILL = 3;
|
||||
|
||||
/**
|
||||
* 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||
@ -251,7 +251,7 @@ class Skill extends CommonObject
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : self::DEFAULT_MAX_RANK_PER_SKILL;
|
||||
$defaultSkillDesc = !empty($conf->global->HRM_DEFAULT_SKILL_DESCRIPTION) ? $conf->global->HRM_DEFAULT_SKILL_DESCRIPTION : 'no Description';
|
||||
$defaultSkillDesc = !empty($conf->global->HRM_DEFAULT_SKILL_DESCRIPTION) ? $conf->global->HRM_DEFAULT_SKILL_DESCRIPTION : $langs->trans("NoDescription");
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
@ -123,11 +123,11 @@ if (empty($reshook)) {
|
||||
|
||||
|
||||
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
|
||||
$noback = 1;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
// action update on Skilldet
|
||||
|
||||
$skilldetArray = GETPOST("descriptionline", "array");
|
||||
$skilldetArray = GETPOST("descriptionline", "array:alphanohtml");
|
||||
|
||||
if (!$error) {
|
||||
if (is_array($skilldetArray) && count($skilldetArray) > 0) {
|
||||
|
||||
@ -141,14 +141,18 @@ class DoliStorage implements TokenStorageInterface
|
||||
dol_syslog("hasAccessToken service=".$service);
|
||||
|
||||
$sql = "SELECT token FROM ".MAIN_DB_PREFIX."oauth_token";
|
||||
$sql .= " WHERE service = '".$this->db->escape($service.($this->keyforprovider?'-'.$this->keyforprovider:''))."'";
|
||||
$sql .= " WHERE service = '".$this->db->escape($service.(empty($this->keyforprovider) ? '' : '-'.$this->keyforprovider))."'";
|
||||
$sql .= " AND entity IN (".getEntity('oauth_token').")";
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
$result = $this->db->fetch_array($resql);
|
||||
$token = unserialize($result['token']);
|
||||
if ($result) {
|
||||
$token = unserialize($result['token']);
|
||||
} else {
|
||||
$token = '';
|
||||
}
|
||||
|
||||
$this->tokens[$service] = $token;
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 335 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user