Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Dec 7, 2019
2 parents 3030a9f + ed4f04f commit 7be8b14
Show file tree
Hide file tree
Showing 25 changed files with 332 additions and 285 deletions.
10 changes: 2 additions & 8 deletions htdocs/adherents/card.php
Expand Up @@ -1072,16 +1072,10 @@ function initfieldrequired()

// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
//Hooks here
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit', $parameters);
}

print '<tbody>';
print "</table>\n";

dol_fiche_end();

print '<div class="center">';
Expand Down Expand Up @@ -1769,7 +1763,7 @@ function initfieldrequired()


/*
* Hotbar
* Action bar
*/

print '<div class="tabsAction">';
Expand Down
45 changes: 30 additions & 15 deletions htdocs/adherents/subscription.php
Expand Up @@ -71,7 +71,6 @@
$extrafields->fetch_name_optionals_label($object->table_element);

$errmsg = '';
$errmsgs = array();

$defaultdelay = 1;
$defaultdelayunit = 'y';
Expand Down Expand Up @@ -687,27 +686,27 @@
$subscriptionstatic = new Subscription($db);

$num = $db->num_rows($result);
$i = 0;

print '<table class="noborder centpercent">'."\n";

print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder);
print '<td class="center">'.$langs->trans("DateCreation").'</td>';
print '<td align="center">'.$langs->trans("Type").'</td>';
print '<td class="center">'.$langs->trans("DateStart").'</td>';
print '<td class="center">'.$langs->trans("DateEnd").'</td>';
print '<td class="right">'.$langs->trans("Amount").'</td>';
print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
if (!empty($conf->banque->enabled))
{
print '<td class="right">'.$langs->trans("Account").'</td>';
print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
}
print "</tr>\n";

$accountstatic = new Account($db);
$adh = new Adherent($db);
$adht = new AdherentType($db);

$i = 0;
while ($i < $num)
{
$objp = $db->fetch_object($result);
Expand Down Expand Up @@ -766,6 +765,13 @@
print "</tr>";
$i++;
}

if (empty($num)) {
$colspan = 6;
if (!empty($conf->banque->enabled)) $colspan++;
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}

print "</table>";
}
else
Expand Down Expand Up @@ -1002,7 +1008,7 @@
print $langs->trans("CreateDolibarrThirdParty");
print '</a>)';
}
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0);
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>';
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled)))
{
$prodtmp = new Product($db);
Expand All @@ -1027,7 +1033,7 @@
print $langs->trans("CreateDolibarrThirdParty");
print '</a>)';
}
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0);
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>';
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled)))
{
$prodtmp = new Product($db);
Expand Down Expand Up @@ -1070,9 +1076,9 @@
}
}

print '<tr><td colspan="2">&nbsp;</td>';
print '<tr><td></td><td></td></tr>';

print '<tr><td width="30%">'.$langs->trans("SendAcknowledgementByMail").'</td>';
print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>';
print '<td>';
if (!$object->email)
{
Expand Down Expand Up @@ -1117,11 +1123,20 @@
$helpcontent .= '<b>'.$langs->trans("MailFrom").'</b>: '.$conf->global->ADHERENT_MAIL_FROM.'<br>'."\n";
$helpcontent .= '<b>'.$langs->trans("MailRecipient").'</b>: '.$object->email.'<br>'."\n";
$helpcontent .= '<b>'.$langs->trans("MailTopic").'</b>:<br>'."\n";
$helpcontent .= $subjecttosend."\n";
if ($subjecttosend) {
$helpcontent .= $subjecttosend."\n";
} else {
$langs->load("errors");
$helpcontent .= '<span class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Module310Name")).'</span>'."\n";
}
$helpcontent .= "<br>";
$helpcontent .= '<b>'.$langs->trans("MailText").'</b>:<br>';
$helpcontent .= dol_htmlentitiesbr($texttosend)."\n";

if ($texttosend) {
$helpcontent .= dol_htmlentitiesbr($texttosend)."\n";
} else {
$langs->load("errors");
$helpcontent .= '<span class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Module310Name")).'</span>'."\n";
}
print $form->textwithpicto($tmp, $helpcontent, 1, 'help', '', 0, 2, 'helpemailtosend');
}
print '</td></tr>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/card.php
Expand Up @@ -1052,7 +1052,7 @@ function init_repeat()

$numproject = $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1);

print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span></a>';
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
$urloption = '?action=create';
$url = dol_buildpath('comm/action/card.php', 2).$urloption;

Expand Down
7 changes: 4 additions & 3 deletions htdocs/comm/propal/card.php
Expand Up @@ -1475,9 +1475,10 @@
{
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
$regs = array();
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
$element = $regs [1];
$subelement = $regs [2];
$element = $regs[1];
$subelement = $regs[2];
}

if ($element == 'project') {
Expand Down Expand Up @@ -1675,7 +1676,7 @@
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td>';
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td>';
print '</tr>';
}
Expand Down
60 changes: 35 additions & 25 deletions htdocs/comm/remx.php
Expand Up @@ -61,9 +61,9 @@
//if ($user->rights->societe->creer)
//if ($user->rights->facture->creer)

$amount_ttc_1 = GETPOST('amount_ttc_1');
$amount_ttc_1 = GETPOST('amount_ttc_1', 'alpha');
$amount_ttc_1 = price2num($amount_ttc_1);
$amount_ttc_2 = GETPOST('amount_ttc_2');
$amount_ttc_2 = GETPOST('amount_ttc_2', 'alpha');
$amount_ttc_2 = price2num($amount_ttc_2);

$error = 0;
Expand Down Expand Up @@ -252,7 +252,7 @@
print '<input type="hidden" name="action" value="setremise">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';

dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), 0, 'company');
dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), -1, 'company');

dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom');

Expand All @@ -273,7 +273,7 @@
}


print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield borderbottom">';

if ($isCustomer) { // Calcul avoirs client en cours
$remise_all = $remise_user = 0;
Expand Down Expand Up @@ -342,13 +342,15 @@

print '</div>';

dol_fiche_end();


if ($user->rights->societe->creer)
{
print '<br>';

print load_fiche_titre($langs->trans("NewGlobalDiscount"), '', '');

print '<div class="underbanner clearboth"></div>';

if ($isCustomer && !$isSupplier) {
print '<input type="hidden" name="discount_type" value="0" />';
Expand All @@ -358,6 +360,8 @@
print '<input type="hidden" name="discount_type" value="1" />';
}

dol_fiche_head();

print '<table class="border centpercent">';
if ($isCustomer && $isSupplier) {
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>';
Expand All @@ -376,9 +380,9 @@
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc', 'none').'"></td></tr>';

print "</table>";
}

dol_fiche_end();
dol_fiche_end();
}

if ($user->rights->societe->creer)
{
Expand All @@ -404,7 +408,7 @@


/*
* Liste remises fixes client restant en cours (= liees a aucune facture ni ligne de facture)
* List remises fixes client restant en cours (= liees a aucune facture ni ligne de facture)
*/

print load_fiche_titre($langs->trans("DiscountStillRemaining"));
Expand Down Expand Up @@ -511,15 +515,14 @@
{
print '<td class="right">'.price($obj->multicurrency_amount_ttc).'</td>';
}
print '<td align="center">';
print '<td class="center">';
print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'</a>';
print '</td>';
if ($user->rights->societe->creer || $user->rights->facture->creer)
{
print '<td class="nowrap">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
//print ' &nbsp; ';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
print '<td class="center nowrap">';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
print '<a class="reposition marginleftonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
print '</td>';
}
else print '<td>&nbsp;</td>';
Expand All @@ -535,7 +538,9 @@
}
else
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
$colspan = 8;
if (!empty($conf->multicurrency->enabled)) $colspan+=2;
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
$db->free($resql);
print "</table>";
Expand All @@ -551,7 +556,7 @@
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
);
$langs->load("dict");
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, '', 0);
}
}
else
Expand Down Expand Up @@ -672,9 +677,8 @@
if ($user->rights->societe->creer || $user->rights->facture->creer)
{
print '<td class="center nowrap">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
//print ' &nbsp; ';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
print '<a class="reposition marginleftonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
print '</td>';
}
else print '<td>&nbsp;</td>';
Expand All @@ -690,7 +694,9 @@
}
else
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
$colspan = 8;
if (!empty($conf->multicurrency->enabled)) $colspan+=2;
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
$db->free($resql);
print "</table>";
Expand All @@ -701,9 +707,9 @@
$amount1 = price2num($showconfirminfo['amount_ttc'] / 2, 'MT');
$amount2 = ($showconfirminfo['amount_ttc'] - $amount1);
$formquestion = array(
'text' => $langs->trans('TypeAmountOfEachNewDiscount'),
array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'),
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
'text' => $langs->trans('TypeAmountOfEachNewDiscount'),
array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'),
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
);
$langs->load("dict");
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
Expand Down Expand Up @@ -738,7 +744,7 @@

// Discount linked to invoice lines
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
$sql .= " rc.fk_facture_source,";
$sql .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture_source,";
$sql .= " u.login, u.rowid as user_id,";
$sql .= " f.rowid as invoiceid, f.ref,";
$sql .= " fa.ref as invoice_source_ref, fa.type as type";
Expand Down Expand Up @@ -890,7 +896,9 @@
}
else
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
$colspan = 8;
if (!empty($conf->multicurrency->enabled)) $colspan+=2;
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}

print "</table>";
Expand Down Expand Up @@ -1064,7 +1072,9 @@
}
else
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
$colspan = 8;
if (!empty($conf->multicurrency->enabled)) $colspan+=2;
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}

print "</table>";
Expand Down
4 changes: 2 additions & 2 deletions htdocs/commande/card.php
Expand Up @@ -1642,7 +1642,7 @@
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddThirdParty").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span></a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
print '</td>';
}
print '</tr>'."\n";
Expand Down Expand Up @@ -1734,7 +1734,7 @@
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td>';
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0);
print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td>';
print '</tr>';
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/compta/bank/card.php
Expand Up @@ -492,11 +492,11 @@
$content = $object->code_guichet;
} elseif ($val == 'BankAccountNumber') {
$name = 'number';
$sizecss = 'minwidth200';
$sizecss = 'minwidth200';
$content = $object->number;
} elseif ($val == 'BankAccountNumberKey') {
$name = 'cle_rib';
$sizecss = 'minwidth50';
$sizecss = 'minwidth50';
$content = $object->cle_rib;
}

Expand Down Expand Up @@ -923,7 +923,7 @@
$cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT);
if (is_array($cats))
{
foreach($cats as $cat) {
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
}
Expand Down

0 comments on commit 7be8b14

Please sign in to comment.