commit
c4acfe5fc0
@ -1370,7 +1370,7 @@ if ($object->id > 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddOrder").'</a></div>';
|
||||
}
|
||||
|
||||
if ($user->rights->contrat->creer && $object->status == 1) {
|
||||
if (!empty($user->rights->contrat->creer) && $object->status == 1) {
|
||||
$langs->load("contracts");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContract").'</a></div>';
|
||||
}
|
||||
|
||||
@ -9298,7 +9298,8 @@ class Form
|
||||
$retstring = $withoutdiv ? '': '<div class="center">';
|
||||
|
||||
foreach ($buttons as $button) {
|
||||
$retstring .= '<input type="submit" class="button button-'.$button['name'].' '.$button['addclass'].'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
|
||||
$addclass = empty($button['addclass']) ? '' : $button['addclass'];
|
||||
$retstring .= '<input type="submit" class="button button-'.$button['name'].' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
|
||||
}
|
||||
$retstring .= $withoutdiv ? '': '</div>';
|
||||
|
||||
|
||||
@ -30,6 +30,14 @@ $objclassname = get_class($object);
|
||||
$isInvoice = in_array($object->element, array('facture', 'invoice', 'facture_fourn', 'invoice_supplier'));
|
||||
$isNewObject = empty($object->id) && empty($object->rowid);
|
||||
|
||||
// Clean variables not defined
|
||||
if (!isset($absolute_discount)) {
|
||||
$absolute_discount = 0;
|
||||
}
|
||||
if (!isset($absolute_creditnote)) {
|
||||
$absolute_creditnote = 0;
|
||||
}
|
||||
|
||||
// Relative and absolute discounts
|
||||
$addrelativediscount = '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$thirdparty->id.'&backtopage='.$backtopage.'">'.$langs->trans("EditRelativeDiscount").'</a>';
|
||||
$addabsolutediscount = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$thirdparty->id.'&backtopage='.$backtopage.'">'.$langs->trans("EditGlobalDiscounts").'</a>';
|
||||
|
||||
@ -73,7 +73,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$hookmanager->initHooks(array('suppliercard', 'globalcard'));
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0);
|
||||
$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0);
|
||||
|
||||
if ($object->id > 0) {
|
||||
if (!($object->fournisseur > 0) || empty($user->rights->fournisseur->lire)) {
|
||||
@ -385,7 +385,7 @@ if ($object->id > 0) {
|
||||
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
|
||||
$boxstat .= '<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
|
||||
|
||||
if ($conf->supplier_proposal->enabled) {
|
||||
if (!empty($conf->supplier_proposal->enabled)) {
|
||||
// Box proposals
|
||||
$tmp = $object->getOutstandingProposals('supplier');
|
||||
$outstandingOpened = $tmp['opened'];
|
||||
@ -428,6 +428,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) {
|
||||
$warn = '';
|
||||
$tmp = $object->getOutstandingBills('supplier');
|
||||
$outstandingOpened = $tmp['opened'];
|
||||
$outstandingTotal = $tmp['total_ht'];
|
||||
@ -584,7 +585,7 @@ if ($object->id > 0) {
|
||||
*/
|
||||
$proposalstatic = new SupplierProposal($db);
|
||||
|
||||
if ($user->rights->supplier_proposal->lire) {
|
||||
if (!empty($user->rights->supplier_proposal->lire)) {
|
||||
$langs->loadLangs(array("supplier_proposal"));
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.date_valid as dc, p.fk_statut, p.total_ht, p.total_tva, p.total_ttc";
|
||||
@ -831,7 +832,7 @@ if ($object->id > 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>';
|
||||
}
|
||||
|
||||
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer) {
|
||||
if (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->creer)) {
|
||||
$langs->load("supplier_proposal");
|
||||
if ($object->status == 1) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddSupplierProposal").'</a>';
|
||||
|
||||
@ -1591,7 +1591,7 @@ if ($action == 'create') {
|
||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="remise_percent" value="'.$soc->remise_supplier_percent.'">';
|
||||
print '<input type="hidden" name="remise_percent" value="'.(empty($soc->remise_supplier_percent) ? '' : $soc->remise_supplier_percent).'">';
|
||||
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
||||
print '<input type="hidden" name="originid" value="'.$originid.'">';
|
||||
if ($backtopage) {
|
||||
@ -1693,7 +1693,7 @@ if ($action == 'create') {
|
||||
$langs->load('projects');
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
||||
print img_picto('', 'project').$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$societe->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$societe->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -485,7 +485,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s.parent = s2.rowid";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (s.rowid = ef.fk_object)";
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user