commit
51176deb41
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
@ -32,12 +32,14 @@ base=$2;
|
|||||||
port=$3;
|
port=$3;
|
||||||
demologin=$4;
|
demologin=$4;
|
||||||
demopass=$5;
|
demopass=$5;
|
||||||
|
demopasshash=$6;
|
||||||
|
|
||||||
# ----------------------------- check params
|
# ----------------------------- check params
|
||||||
if [ "x$confirm" != "xconfirm" ]
|
if [ "x$confirm" != "xconfirm" ]
|
||||||
then
|
then
|
||||||
echo "----- $0 -----"
|
echo "----- $0 -----"
|
||||||
echo "Usage: initdemopassword.sh confirm [base port login pass]"
|
echo "Usage: initdemopassword.sh confirm [base port login pass password_hash_algo]"
|
||||||
|
echo "password_hash_algo can be md5 or password_hash"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -147,8 +149,20 @@ then
|
|||||||
fi
|
fi
|
||||||
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
|
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
|
||||||
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||||
echo "echo \"UPDATE llx_user SET pass_crypted = MD5('$demopass') WHERE login = '$demologin';\" | mysql -P$port $base"
|
|
||||||
echo "UPDATE llx_user SET pass_crypted = MD5('$demopass') WHERE login = '$demologin';" | mysql -P$port $base
|
if [ "x${demopasshash}" != "xpassword_hash" ]
|
||||||
|
then
|
||||||
|
echo '<?php echo MD5("$demopass"); ?>' > /tmp/tmp.php
|
||||||
|
newpass=`php -f /tmp/tmp.php`
|
||||||
|
rm /tmp/tmp.php
|
||||||
|
else
|
||||||
|
echo '<?php echo password_hash("'$demopass'", PASSWORD_DEFAULT); ?>' > /tmp/tmp.php
|
||||||
|
newpass=`php -f /tmp/tmp.php`
|
||||||
|
rm /tmp/tmp.php
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "echo \"UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';\" | mysql -P$port $base"
|
||||||
|
echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql -P$port $base
|
||||||
export res=$?
|
export res=$?
|
||||||
|
|
||||||
if [ $res -ne 0 ]; then
|
if [ $res -ne 0 ]; then
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -259,6 +259,7 @@ export list="
|
|||||||
--ignore-table=$base.llx_dolireport_plot
|
--ignore-table=$base.llx_dolireport_plot
|
||||||
--ignore-table=$base.llx_dolireport_report
|
--ignore-table=$base.llx_dolireport_report
|
||||||
--ignore-table=$base.llx_domain
|
--ignore-table=$base.llx_domain
|
||||||
|
--ignore-table=$base.llx_ecommerce_category
|
||||||
--ignore-table=$base.llx_ecommerce_commande
|
--ignore-table=$base.llx_ecommerce_commande
|
||||||
--ignore-table=$base.llx_ecommerce_facture
|
--ignore-table=$base.llx_ecommerce_facture
|
||||||
--ignore-table=$base.llx_ecommerce_product
|
--ignore-table=$base.llx_ecommerce_product
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
Options -Indexes
|
|
||||||
@ -97,7 +97,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
|
|||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -54,8 +54,8 @@ $code = GETPOST('code', 'alpha');
|
|||||||
|
|
||||||
$acts[0] = "activate";
|
$acts[0] = "activate";
|
||||||
$acts[1] = "disable";
|
$acts[1] = "disable";
|
||||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
|
||||||
|
|
||||||
$listoffset = GETPOST('listoffset', 'alpha');
|
$listoffset = GETPOST('listoffset', 'alpha');
|
||||||
$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
|
$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
|
||||||
|
|||||||
@ -48,8 +48,8 @@ if (empty($user->rights->accounting->chartofaccount)) {
|
|||||||
|
|
||||||
$acts[0] = "activate";
|
$acts[0] = "activate";
|
||||||
$acts[1] = "disable";
|
$acts[1] = "disable";
|
||||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
|
||||||
|
|
||||||
$listoffset = GETPOST('listoffset', 'alpha');
|
$listoffset = GETPOST('listoffset', 'alpha');
|
||||||
$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
|
$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
|
||||||
|
|||||||
@ -51,8 +51,8 @@ if (empty($user->rights->accounting->chartofaccount)) {
|
|||||||
|
|
||||||
$acts[0] = "activate";
|
$acts[0] = "activate";
|
||||||
$acts[1] = "disable";
|
$acts[1] = "disable";
|
||||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
|
||||||
|
|
||||||
$listoffset = GETPOST('listoffset', 'alpha');
|
$listoffset = GETPOST('listoffset', 'alpha');
|
||||||
$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
|
$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
|
||||||
|
|||||||
@ -183,7 +183,7 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
// setEventMessages(null, $accounting->errors, 'errors');
|
// setEventMessages(null, $accounting->errors, 'errors');
|
||||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br/> <pre>'.$sql.'</pre></span></div>';
|
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
|
||||||
$ko++;
|
$ko++;
|
||||||
} else {
|
} else {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|||||||
@ -400,11 +400,11 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'ventil'=>$langs->trans("Ventilate")
|
'ventil'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate")
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
//if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
//if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
|
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
|
||||||
|
|
||||||
|
|||||||
@ -164,7 +164,7 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
$msg .= '<div><span style="color:green">'.$langs->trans("LineOfExpenseReport").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
$msg .= '<div><span style="color:green">'.$langs->trans("LineOfExpenseReport").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||||
$ok++;
|
$ok++;
|
||||||
} else {
|
} else {
|
||||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br/> <pre>'.$sql.'</pre></span></div>';
|
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br> <pre>'.$sql.'</pre></span></div>';
|
||||||
$ko++;
|
$ko++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -298,7 +298,7 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'ventil' => $langs->trans("Ventilate")
|
'ventil' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate")
|
||||||
);
|
);
|
||||||
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
|
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
|
||||||
|
|
||||||
|
|||||||
@ -35,16 +35,23 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy", "loans", "ban
|
|||||||
$hookmanager->initHooks(array('accountancyindex'));
|
$hookmanager->initHooks(array('accountancyindex'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($conf->accounting->enabled)) {
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if ($user->socid > 0) {
|
/*
|
||||||
|
if (empty($conf->accounting->enabled)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled) && empty($conf->asset->enabled) && empty($conf->intracommreport->enabled)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -188,7 +188,7 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
|||||||
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||||
$ok++;
|
$ok++;
|
||||||
} else {
|
} else {
|
||||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br/> <pre>'.$sql.'</pre></span></div>';
|
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br> <pre>'.$sql.'</pre></span></div>';
|
||||||
$ko++;
|
$ko++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -407,11 +407,11 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'ventil'=>$langs->trans("Ventilate")
|
'ventil'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate")
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
//if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
//if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||||
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
|
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,6 @@ if ($action == 'set_default') {
|
|||||||
$res2 = dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res2 = dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res3 = dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res3 = dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res7 = dolibarr_set_const($db, "MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE", json_encode(GETPOST('MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE')), 'array', 0, '', $conf->entity);
|
|
||||||
// Use vat for invoice creation
|
// Use vat for invoice creation
|
||||||
if ($conf->facture->enabled) {
|
if ($conf->facture->enabled) {
|
||||||
$res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
@ -220,18 +219,6 @@ print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDef
|
|||||||
print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
|
print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
|
||||||
// Amount by member type
|
|
||||||
$adht = new AdherentType($db);
|
|
||||||
$amountbytype = empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE) ? -1 : json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true);
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DefineAmountMemberType").'</td><td>';
|
|
||||||
foreach ($adht->liste_array(1) as $typeid => $type) {
|
|
||||||
print $type .' : ';
|
|
||||||
print '<input type="text" id="MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE['.$typeid.']" name="MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE['.$typeid.']" " size="5" value="'.(!empty($amountbytype[$typeid]) ? $amountbytype[$typeid] : '').'">';
|
|
||||||
print '<br>';
|
|
||||||
}
|
|
||||||
print "</td></tr>\n";
|
|
||||||
|
|
||||||
// Insert subscription into bank account
|
// Insert subscription into bank account
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
|
||||||
$arraychoices = array('0'=>$langs->trans("None"));
|
$arraychoices = array('0'=>$langs->trans("None"));
|
||||||
|
|||||||
@ -231,7 +231,7 @@ print '</form>';
|
|||||||
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
||||||
print '<br>';
|
print '<br>';
|
||||||
//print $langs->trans('FollowingLinksArePublic').'<br>';
|
//print $langs->trans('FollowingLinksArePublic').'<br>';
|
||||||
print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').':<br>';
|
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';
|
||||||
if (!empty($conf->multicompany->enabled)) {
|
if (!empty($conf->multicompany->enabled)) {
|
||||||
$entity_qr = '?entity='.$conf->entity;
|
$entity_qr = '?entity='.$conf->entity;
|
||||||
} else {
|
} else {
|
||||||
@ -243,7 +243,11 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
|
|||||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
print '<a target="_blank" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.$urlwithroot.'/public/members/new.php'.$entity_qr.'</a>';
|
print '<div class="urllink">';
|
||||||
|
print '<input type="text" id="publicurlmember" class="quatrevingtpercent" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
|
||||||
|
print '<a target="_blank" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||||
|
print '</div>';
|
||||||
|
print ajax_autoselect('publicurlmember');
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -183,7 +183,7 @@ if ($id > 0) {
|
|||||||
$permission = $user->rights->adherent->creer;
|
$permission = $user->rights->adherent->creer;
|
||||||
$permtoedit = $user->rights->adherent->creer;
|
$permtoedit = $user->rights->adherent->creer;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
print "<br><br>";
|
print "<br><br>";
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
|
|||||||
@ -543,17 +543,17 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').' '.$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($user->rights->adherent->creer) {
|
if ($user->rights->adherent->creer) {
|
||||||
$arrayofmassactions['close'] = $langs->trans("Resiliate");
|
$arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Resiliate");
|
||||||
}
|
}
|
||||||
if ($user->rights->adherent->supprimer) {
|
if ($user->rights->adherent->supprimer) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if ($user->rights->societe->creer) {
|
if ($user->rights->societe->creer) {
|
||||||
$arrayofmassactions['preaffecttag'] = '<span class="fa fa-tag paddingrightonly"></span>'.$langs->trans("AffectTag");
|
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||||
}
|
}
|
||||||
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
|
|||||||
@ -287,10 +287,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
//if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
if (in_array($massaction, array('presend', 'predelete'))) {
|
if (in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/accountant.php
|
* \file htdocs/admin/accountant.php
|
||||||
* \ingroup accountant
|
* \ingroup core
|
||||||
* \brief Setup page to configure accountant / auditor
|
* \brief Setup page to configure accountant / auditor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
68
htdocs/admin/accounting.php
Normal file
68
htdocs/admin/accounting.php
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2018 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/admin/accounting.php
|
||||||
|
* \ingroup accounting
|
||||||
|
* \brief Setup page to configure accountanting module
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array('admin', 'companies'));
|
||||||
|
|
||||||
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Nothing
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$help_url = '';
|
||||||
|
llxHeader('', $langs->trans("ConfigAccountingExpert"), $help_url);
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("ConfigAccountingExpert"), $linkback, 'title_setup');
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup"))."</span><br>\n";
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -112,8 +112,11 @@ if ($action == "save" && empty($cancel)) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
// $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
|
|
||||||
|
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||||
|
|
||||||
|
llxHeader('', $langs->trans("AgendaSetup"), $help_url);
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
||||||
|
|||||||
@ -160,19 +160,31 @@ $getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
|||||||
|
|
||||||
// Show message
|
// Show message
|
||||||
$message = '';
|
$message = '';
|
||||||
|
|
||||||
$urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
|
$urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
|
||||||
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||||
$message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal);
|
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'</span>');
|
||||||
|
$message .= '<div class="urllink">';
|
||||||
|
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||||
|
$message .= '</div>';
|
||||||
$message .= '<br>';
|
$message .= '<br>';
|
||||||
|
|
||||||
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
|
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
|
||||||
$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||||
$message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical);
|
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'</span>');
|
||||||
|
$message .= '<div class="urllink">';
|
||||||
|
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||||
|
$message .= '</div>';
|
||||||
$message .= '<br>';
|
$message .= '<br>';
|
||||||
|
|
||||||
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
|
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
|
||||||
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
|
||||||
$message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'rss', $urlrss);
|
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'</span>');
|
||||||
$message .= '<br>';
|
$message .= '<div class="urllink">';
|
||||||
|
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
|
||||||
|
$message .= '</div>';
|
||||||
$message .= '<br>';
|
$message .= '<br>';
|
||||||
|
|
||||||
print $message;
|
print $message;
|
||||||
|
|
||||||
$message = $langs->trans("AgendaUrlOptions1", $user->login, $user->login).'<br>';
|
$message = $langs->trans("AgendaUrlOptions1", $user->login, $user->login).'<br>';
|
||||||
|
|||||||
@ -316,9 +316,9 @@ print '<div class="div-table-responsive-no-min">';
|
|||||||
print '<table class="tagtable liste centpercent">'."\n";
|
print '<table class="tagtable liste centpercent">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
print '<td>'.$langs->trans("Box").'</td>';
|
||||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||||
print '<td>'.$langs->trans("SourceFile").'</td>';
|
print '<td></td>';
|
||||||
print '<td width="160" class="center">'.$langs->trans("ActivatableOn").'</td>';
|
print '<td width="160" class="center">'.$langs->trans("ActivatableOn").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -333,7 +333,14 @@ foreach ($boxtoadd as $box) {
|
|||||||
print '<tr class="oddeven">'."\n";
|
print '<tr class="oddeven">'."\n";
|
||||||
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||||
if (!empty($box->class) && preg_match('/graph_/', $box->class)) {
|
if (!empty($box->class) && preg_match('/graph_/', $box->class)) {
|
||||||
print ' ('.$langs->trans("Graph").')';
|
print img_picto('', 'graph', 'class="paddingleft"');
|
||||||
|
}
|
||||||
|
if (!empty($box->version)) {
|
||||||
|
if ($box->version == 'experimental') {
|
||||||
|
print ' <span class="opacitymedium">('.$langs->trans("Experimental").')</span>';
|
||||||
|
} elseif ($box->version == 'development') {
|
||||||
|
print ' <span class="opacitymedium">('.$langs->trans("Development").')</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -344,7 +351,9 @@ foreach ($boxtoadd as $box) {
|
|||||||
print ($box->note ? $box->note : ' ');
|
print ($box->note ? $box->note : ' ');
|
||||||
}
|
}
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
print '<td>'.$box->sourcefile.'</td>'."\n";
|
print '<td>';
|
||||||
|
print $form->textwithpicto('', $langs->trans("SourceFile").' : '.$box->sourcefile);
|
||||||
|
print '</td>'."\n";
|
||||||
|
|
||||||
// For each possible position, an activation link is displayed if the box is not already active for that position
|
// For each possible position, an activation link is displayed if the box is not already active for that position
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
@ -375,7 +384,7 @@ print '<div class="div-table-responsive-no-min">';
|
|||||||
print '<table class="tagtable liste">'."\n";
|
print '<table class="tagtable liste">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="300">'.$langs->trans("Box").'</td>';
|
print '<td>'.$langs->trans("Box").'</td>';
|
||||||
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
|
||||||
print '<td class="center" width="160">'.$langs->trans("ActivatableOn").'</td>';
|
print '<td class="center" width="160">'.$langs->trans("ActivatableOn").'</td>';
|
||||||
print '<td class="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>';
|
print '<td class="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>';
|
||||||
@ -395,7 +404,14 @@ foreach ($boxactivated as $key => $box) {
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||||
if (!empty($box->class) && preg_match('/graph_/', $box->class)) {
|
if (!empty($box->class) && preg_match('/graph_/', $box->class)) {
|
||||||
print ' ('.$langs->trans("Graph").')';
|
print img_picto('', 'graph', 'class="paddingleft"');
|
||||||
|
}
|
||||||
|
if (!empty($box->version)) {
|
||||||
|
if ($box->version == 'experimental') {
|
||||||
|
print ' <span class="opacitymedium">('.$langs->trans("Experimental").')</span>';
|
||||||
|
} elseif ($box->version == 'development') {
|
||||||
|
print ' <span class="opacitymedium">('.$langs->trans("Development").')</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -666,7 +666,7 @@ print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
|
||||||
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').'</td></tr>';
|
print $formother->select_month(!empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').'</td></tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -169,17 +169,32 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
|
|||||||
// Show message
|
// Show message
|
||||||
$message = '';
|
$message = '';
|
||||||
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">'.$urlwithroot.'/dav/fileserver.php</a>';
|
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">'.$urlwithroot.'/dav/fileserver.php</a>';
|
||||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV', '{url}'));
|
|
||||||
|
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV', ''));
|
||||||
|
$message .= '<div class="urllink"><input type="text" id="webdavpublicurl" class="quatrevingtpercent" value="'.$urlwithroot.'/dav/fileserver.php">';
|
||||||
|
$message .= '<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">';
|
||||||
|
$message .= ' '.img_picto('', 'globe');
|
||||||
|
$message .= '</a>';
|
||||||
|
$message .= '</div>';
|
||||||
|
$message .= ajax_autoselect('webdavpublicurl');
|
||||||
|
|
||||||
$message .= '<br>';
|
$message .= '<br>';
|
||||||
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) {
|
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) {
|
||||||
$urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : '');
|
$urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : '');
|
||||||
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
|
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
|
||||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', '{url}'));
|
|
||||||
|
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', ''));
|
||||||
|
$message .= '<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'">';
|
||||||
|
$message .= '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">';
|
||||||
|
$message .= ' '.img_picto('', 'globe');
|
||||||
|
$message .= '</a>';
|
||||||
|
$message .= '</div>';
|
||||||
|
$message .= ajax_autoselect('webdavurl');
|
||||||
$message .= '<br>';
|
$message .= '<br>';
|
||||||
}
|
}
|
||||||
print $message;
|
print $message;
|
||||||
|
|
||||||
print '<br><br><br>';
|
print '<br>';
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/includes/sabre/autoload.php';
|
require_once DOL_DOCUMENT_ROOT.'/includes/sabre/autoload.php';
|
||||||
$version = Sabre\DAV\Version::VERSION;
|
$version = Sabre\DAV\Version::VERSION;
|
||||||
|
|||||||
@ -289,7 +289,7 @@ if ($action == 'edit') {
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
if ($conf->global->MAIN_DISABLE_METEO != 1) {
|
if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) {
|
||||||
// Show logo for weather
|
// Show logo for weather
|
||||||
print '<span class="opacitymedium">'.$langs->trans("DescWeather").'</span> ';
|
print '<span class="opacitymedium">'.$langs->trans("DescWeather").'</span> ';
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ if ($conf->global->MAIN_DISABLE_METEO != 1) {
|
|||||||
$str_mode_enabled = $str_mode_percentage;
|
$str_mode_enabled = $str_mode_percentage;
|
||||||
}
|
}
|
||||||
print '<a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>';
|
print '<a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>';
|
||||||
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.$conf->global->MAIN_USE_METEO_WITH_PERCENTAGE.'" />';
|
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? $conf->global->MAIN_USE_METEO_WITH_PERCENTAGE : '').'" />';
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -322,7 +322,7 @@ class Dolistore
|
|||||||
$html .= '<tr class="app oddeven '.$compatible.'">
|
$html .= '<tr class="app oddeven '.$compatible.'">
|
||||||
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
|
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
|
||||||
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
|
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
|
||||||
.'<br/><small>'.$version.'</small></h2>
|
.'<br><small>'.$version.'</small></h2>
|
||||||
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
|
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
|
||||||
// do not load if display none
|
// do not load if display none
|
||||||
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
|
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
|
||||||
|
|||||||
@ -356,11 +356,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($permissiontodelete) {
|
if ($permissiontodelete) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $modules = array(
|
|||||||
$conditions = array(
|
$conditions = array(
|
||||||
'SOCIETE' => 1,
|
'SOCIETE' => 1,
|
||||||
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
|
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
|
||||||
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||||
'USERSIGN' => 1,
|
'USERSIGN' => 1,
|
||||||
'MAILING' => !empty($conf->mailing->enabled),
|
'MAILING' => !empty($conf->mailing->enabled),
|
||||||
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
|
||||||
|
|||||||
@ -211,11 +211,12 @@ if ($action == 'update') {
|
|||||||
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST("MAIN_BUGTRACK_ENABLELINK", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'restricthtml')), 'chaine', 0, '', $conf->entity);
|
||||||
//dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity);
|
|
||||||
//dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
|
//dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
|
||||||
|
|
||||||
$varforimage = 'imagebackground'; $dirforimage = $conf->mycompany->dir_output.'/logos/';
|
$varforimage = 'imagebackground'; $dirforimage = $conf->mycompany->dir_output.'/logos/';
|
||||||
@ -401,8 +402,7 @@ print '</tr>';
|
|||||||
|
|
||||||
// Show bugtrack link
|
// Show bugtrack link
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
||||||
print ajax_constantonoff("MAIN_BUGTRACK_ENABLELINK", array(), $conf->entity, 0, 0, 1, 0);
|
print '<input type="text" name="MAIN_BUGTRACK_ENABLELINK" size="32" value="'.(isset($conf->global->MAIN_BUGTRACK_ENABLELINK) ? $conf->global->MAIN_BUGTRACK_ENABLELINK : '').'">';
|
||||||
//print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1);
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $substitutionarrayfortest = array(
|
|||||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
'__ID__' => 'RecipientIdRecord',
|
'__ID__' => 'RecipientIdRecord',
|
||||||
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||||
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
'__CHECK_READ__' => (is_object($object) && !empty($object->thirdparty) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
||||||
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
||||||
'__LOGIN__' => 'RecipientLogin',
|
'__LOGIN__' => 'RecipientLogin',
|
||||||
'__LASTNAME__' => 'RecipientLastname',
|
'__LASTNAME__' => 'RecipientLastname',
|
||||||
@ -554,7 +554,7 @@ if ($action == 'edit') {
|
|||||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
// Disable
|
// Disable
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_MAILS);
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn(!empty($conf->global->MAIN_DISABLE_ALL_MAILS));
|
||||||
if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
||||||
print img_warning($langs->trans("Disabled"));
|
print img_warning($langs->trans("Disabled"));
|
||||||
}
|
}
|
||||||
@ -737,14 +737,14 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') {
|
if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') {
|
||||||
print $langs->trans('RobotEmail');
|
print $langs->trans('RobotEmail');
|
||||||
} elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') {
|
} elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') {
|
||||||
print $langs->trans('UserEmail');
|
print $langs->trans('UserEmail');
|
||||||
} elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') {
|
} elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') {
|
||||||
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
|
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
|
||||||
} else {
|
} else {
|
||||||
$id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE);
|
$id = preg_replace('/senderprofile_/', '', !empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : '');
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php';
|
||||||
$emailsenderprofile = new EmailSenderProfile($db);
|
$emailsenderprofile = new EmailSenderProfile($db);
|
||||||
@ -756,7 +756,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
// Errors To
|
// Errors To
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
||||||
print '<td>'.$conf->global->MAIN_MAIL_ERRORS_TO;
|
print '<td>'.(!empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : '');
|
||||||
if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) {
|
if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) {
|
||||||
print img_warning($langs->trans("ErrorBadEMail"));
|
print img_warning($langs->trans("ErrorBadEMail"));
|
||||||
}
|
}
|
||||||
@ -776,7 +776,7 @@ if ($action == 'edit') {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
//Add user to select destinaries list
|
//Add user to select destinaries list
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>'.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'</td></tr>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>'.yn(!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)).'</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -354,10 +354,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if ($permissiontodelete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
//if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
|
//if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
|
||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
|
|||||||
@ -74,8 +74,8 @@ $acts = array();
|
|||||||
$actl = array();
|
$actl = array();
|
||||||
$acts[0] = "activate";
|
$acts[0] = "activate";
|
||||||
$acts[1] = "disable";
|
$acts[1] = "disable";
|
||||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
|
||||||
|
|
||||||
$listoffset = GETPOST('listoffset', 'alpha');
|
$listoffset = GETPOST('listoffset', 'alpha');
|
||||||
$listlimit = GETPOST('listlimit', 'alpha') > 0 ?GETPOST('listlimit', 'alpha') : 1000;
|
$listlimit = GETPOST('listlimit', 'alpha') > 0 ?GETPOST('listlimit', 'alpha') : 1000;
|
||||||
@ -1003,7 +1003,7 @@ if ($resql) {
|
|||||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||||
|
|
||||||
$tmpaction = 'view';
|
$tmpaction = 'view';
|
||||||
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
$reshook = $hookmanager->executeHooks('viewEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('viewEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||||
@ -1016,6 +1016,7 @@ if ($resql) {
|
|||||||
$showfield = 1;
|
$showfield = 1;
|
||||||
$align = "";
|
$align = "";
|
||||||
$class = "tddict";
|
$class = "tddict";
|
||||||
|
$title = '';
|
||||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||||
if ($value == 'label' || $value == 'topic') {
|
if ($value == 'label' || $value == 'topic') {
|
||||||
if ($langs->trans($valuetoshow) != $valuetoshow) {
|
if ($langs->trans($valuetoshow) != $valuetoshow) {
|
||||||
@ -1025,11 +1026,10 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
if ($value == 'label') {
|
if ($value == 'label') {
|
||||||
$class .= ' tdoverflowmax100';
|
$class .= ' tdoverflowmax100';
|
||||||
$valuetoshow = '<span title="'.$valuetoshow.'">'.$valuetoshow.'</span>';
|
|
||||||
}
|
}
|
||||||
/*if ($value == 'topic') {
|
if ($value == 'topic') {
|
||||||
$class .= ' tdoverflowmax300';
|
$class .= 'tdoverflowmax200 small';
|
||||||
}*/
|
}
|
||||||
if ($value == 'type_template') {
|
if ($value == 'type_template') {
|
||||||
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
||||||
$align = "center";
|
$align = "center";
|
||||||
@ -1070,7 +1070,13 @@ if ($resql) {
|
|||||||
// Show value for field
|
// Show value for field
|
||||||
if ($showfield) {
|
if ($showfield) {
|
||||||
print '<!-- '.$fieldlist[$field].' -->';
|
print '<!-- '.$fieldlist[$field].' -->';
|
||||||
print '<td class="'.$class.'">'.$valuetoshow.'</td>';
|
print '<td class="'.$class.'"';
|
||||||
|
if ($value == 'topic') {
|
||||||
|
print ' title="'.$valuetoshow.'"';
|
||||||
|
}
|
||||||
|
print '>';
|
||||||
|
print $valuetoshow;
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1087,12 +1093,11 @@ if ($resql) {
|
|||||||
if ($param) {
|
if ($param) {
|
||||||
$url .= '&'.$param;
|
$url .= '&'.$param;
|
||||||
}
|
}
|
||||||
$url .= '&';
|
|
||||||
|
|
||||||
// Status / Active
|
// Status / Active
|
||||||
print '<td class="center nowrap">';
|
print '<td class="center nowrap">';
|
||||||
if ($canbedisabled) {
|
if ($canbedisabled) {
|
||||||
print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
print '<a href="'.$url.'&action='.$acts[$obj->active].'&token='.newToken().'">'.$actl[$obj->active].'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="opacitymedium">'.$actl[$obj->active].'</span>';
|
print '<span class="opacitymedium">'.$actl[$obj->active].'</span>';
|
||||||
}
|
}
|
||||||
@ -1101,10 +1106,10 @@ if ($resql) {
|
|||||||
// Modify link / Delete link
|
// Modify link / Delete link
|
||||||
print '<td class="center nowraponall" width="64">';
|
print '<td class="center nowraponall" width="64">';
|
||||||
if ($canbemodified) {
|
if ($canbemodified) {
|
||||||
print '<a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a>';
|
print '<a class="reposition editfielda" href="'.$url.'&action=edit&token='.newToken().'">'.img_edit().'</a>';
|
||||||
}
|
}
|
||||||
if ($iserasable) {
|
if ($iserasable) {
|
||||||
print '<a class="marginleftonly" href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
|
print '<a class="marginleftonly" href="'.$url.'&action=delete&token='.newToken().'">'.img_delete().'</a>';
|
||||||
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -520,9 +520,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
|
|
||||||
$moreforfilter = '<div class="valignmiddle">';
|
$moreforfilter = '<div class="valignmiddle">';
|
||||||
|
|
||||||
$moreforfilter .= '<div class="floatright right pagination"><ul><li>';
|
$moreforfilter .= '<div class="floatright right pagination --module-list"><ul><li>';
|
||||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'common' ? '' : ' btnTitleSelected')));
|
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br>'.$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition'));
|
||||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'commonkanban' ? '' : ' btnTitleSelected')));
|
$moreforfilter .= dolGetButtonTitleSeparator();
|
||||||
|
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
|
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
$moreforfilter .= '</li></ul></div>';
|
$moreforfilter .= '</li></ul></div>';
|
||||||
|
|
||||||
//$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="paddingright">'.$moreinfo.'</span> '.$moreinfo2.'</div>';
|
//$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="paddingright">'.$moreinfo.'</span> '.$moreinfo2.'</div>';
|
||||||
@ -582,8 +584,8 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
|
|
||||||
// Show list of modules
|
// Show list of modules
|
||||||
$oldfamily = '';
|
$oldfamily = '';
|
||||||
|
$foundoneexternalmodulewithupdate = 0;
|
||||||
$linenum = 0;
|
$linenum = 0;
|
||||||
|
|
||||||
foreach ($orders as $key => $value) {
|
foreach ($orders as $key => $value) {
|
||||||
$linenum++;
|
$linenum++;
|
||||||
$tab = explode('_', $value);
|
$tab = explode('_', $value);
|
||||||
@ -591,6 +593,8 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
$module_position = $tab[2];
|
$module_position = $tab[2];
|
||||||
|
|
||||||
$modName = $filename[$key];
|
$modName = $filename[$key];
|
||||||
|
|
||||||
|
/** @var DolibarrModules $objMod */
|
||||||
$objMod = $modules[$modName];
|
$objMod = $modules[$modName];
|
||||||
|
|
||||||
//print $objMod->name." - ".$key." - ".$objMod->version."<br>";
|
//print $objMod->name." - ".$key." - ".$objMod->version."<br>";
|
||||||
@ -719,6 +723,22 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
$versiontrans .= $objMod->getVersion(1);
|
$versiontrans .= $objMod->getVersion(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($objMod->isCoreOrExternalModule() == 'external'
|
||||||
|
&& (
|
||||||
|
$action == 'checklastversion'
|
||||||
|
// This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application.
|
||||||
|
// Adding a cron job could be a good idea see DolibarrModules::checkForUpdate()
|
||||||
|
|| !empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
$checkRes = $objMod->checkForUpdate();
|
||||||
|
if ($checkRes > 0) {
|
||||||
|
setEventMessage($objMod->getName().' : '.$versiontrans.' -> '.$objMod->lastVersion);
|
||||||
|
} elseif ($checkRes < 0) {
|
||||||
|
setEventMessage($objMod->getName().' '.$langs->trans('CheckVersionFail'), 'warnings');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Define imginfo
|
// Define imginfo
|
||||||
$imginfo = "info";
|
$imginfo = "info";
|
||||||
if ($objMod->isCoreOrExternalModule() == 'external') {
|
if ($objMod->isCoreOrExternalModule() == 'external') {
|
||||||
@ -893,17 +913,12 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
|
|
||||||
// Version
|
// Version
|
||||||
print '<td class="center nowrap" width="120px">';
|
print '<td class="center nowrap" width="120px">';
|
||||||
|
if ($objMod->needUpdate) {
|
||||||
|
$versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
|
||||||
|
print '<span class="badge badge-warning classfortooltip" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
|
||||||
|
$foundoneexternalmodulewithupdate++;
|
||||||
|
} else {
|
||||||
print $versiontrans;
|
print $versiontrans;
|
||||||
if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { // This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application.
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
|
||||||
if (!empty($objMod->url_last_version)) {
|
|
||||||
$newversion = getURLContent($objMod->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
|
|
||||||
if (isset($newversion['content'])) {
|
|
||||||
if (version_compare($newversion['content'], $versiontrans) > 0) {
|
|
||||||
print " <span class='butAction' title='".$langs->trans('LastStableVersion')."'>".$newversion['content']."</span>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
@ -921,6 +936,14 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'checklastversion') {
|
||||||
|
if ($foundoneexternalmodulewithupdate) {
|
||||||
|
setEventMessages($langs->trans("ModuleUpdateAvailable"), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("NoExternalModuleWithUpdate"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($oldfamily) {
|
if ($oldfamily) {
|
||||||
if ($mode == 'commonkanban') {
|
if ($mode == 'commonkanban') {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -254,9 +254,13 @@ foreach ($arrayhandler as $key => $module) {
|
|||||||
|
|
||||||
print '<td width="100" align="center">';
|
print '<td width="100" align="center">';
|
||||||
if ($conf->global->USER_PASSWORD_GENERATED == $key) {
|
if ($conf->global->USER_PASSWORD_GENERATED == $key) {
|
||||||
print img_picto('', 'tick');
|
//print img_picto('', 'tick');
|
||||||
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&token='.newToken().'&value='.$key.'">'.$langs->trans("Activate").'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&token='.newToken().'&value='.$key.'">';
|
||||||
|
//print $langs->trans("Activate");
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a>';
|
||||||
}
|
}
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -172,7 +172,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
// Disable
|
// Disable
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>';
|
||||||
print $form->selectyesno('MAIN_DISABLE_ALL_SMS', $conf->global->MAIN_DISABLE_ALL_SMS, 1);
|
print $form->selectyesno('MAIN_DISABLE_ALL_SMS', getDolGlobalString('MAIN_DISABLE_ALL_SMS'), 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
@ -189,7 +189,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
// From
|
// From
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).'</td>';
|
||||||
print '<td><input class="flat" name="MAIN_MAIL_SMS_FROM" size="32" value="'.$conf->global->MAIN_MAIL_SMS_FROM;
|
print '<td><input class="flat" name="MAIN_MAIL_SMS_FROM" size="32" value="'.getDolGlobalString('MAIN_MAIL_SMS_FROM');
|
||||||
print '"></td></tr>';
|
print '"></td></tr>';
|
||||||
|
|
||||||
// Autocopy to
|
// Autocopy to
|
||||||
@ -213,14 +213,14 @@ if ($action == 'edit') {
|
|||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
// Disable
|
// Disable
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_SMS).'</td></tr>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>'.yn(getDolGlobalString('MAIN_DISABLE_ALL_SMS')).'</td></tr>';
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
print '<tr class="oddeven"><td colspan="2"> </td></tr>';
|
print '<tr class="oddeven"><td colspan="2"> </td></tr>';
|
||||||
|
|
||||||
// Method
|
// Method
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
||||||
$text = $listofmethods[$conf->global->MAIN_SMS_SENDMODE];
|
$text = empty(getDolGlobalString('MAIN_SMS_SENDMODE')) ? '' : $listofmethods[getDolGlobalString('MAIN_SMS_SENDMODE')];
|
||||||
if (empty($text)) {
|
if (empty($text)) {
|
||||||
$text = $langs->trans("Undefined").' '.img_warning();
|
$text = $langs->trans("Undefined").' '.img_warning();
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
// From
|
// From
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).'</td>';
|
||||||
print '<td>'.$conf->global->MAIN_MAIL_SMS_FROM;
|
print '<td>'.getDolGlobalString('MAIN_MAIL_SMS_FROM');
|
||||||
if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && !isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) {
|
if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && !isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) {
|
||||||
print ' '.img_warning($langs->trans("ErrorBadPhone"));
|
print ' '.img_warning($langs->trans("ErrorBadPhone"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -293,7 +293,7 @@ $found = 0;
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("ReStockOnBill").'</td>';
|
print '<td>'.$langs->trans("ReStockOnBill").'</td>';
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1);
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1);
|
||||||
} else {
|
} else {
|
||||||
@ -311,7 +311,7 @@ $found++;
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
|
print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
|
||||||
} else {
|
} else {
|
||||||
@ -356,7 +356,7 @@ if (!empty($conf->reception->enabled)) {
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
|
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if (!empty($conf->fournisseur->enabled)) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1);
|
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -110,7 +110,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|||||||
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
||||||
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
|
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
|
||||||
if (dol_is_file($xmlfile)) {
|
if (dol_is_file($xmlfile)) {
|
||||||
print '<input type="radio" name="target" value="local"'.((!GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"' : '').'"> '.$langs->trans("LocalSignature").' = ';
|
print '<input type="radio" name="target" id="checkboxlocal" value="local"'.((!GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"' : '').'"> <label for="checkboxlocal">'.$langs->trans("LocalSignature").'</label> = ';
|
||||||
print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
|
print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
} else {
|
} else {
|
||||||
@ -121,7 +121,7 @@ if (dol_is_file($xmlfile)) {
|
|||||||
}
|
}
|
||||||
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
||||||
if ($enableremotecheck) {
|
if ($enableremotecheck) {
|
||||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> '.$langs->trans("RemoteSignature").' = ';
|
print '<input type="radio" name="target" id="checkboxremote" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> <label for="checkboxremote">'.$langs->trans("RemoteSignature").'</label> = ';
|
||||||
print '<input name="xmlremote" class="flat minwidth400" value="'.dol_escape_htmltag($xmlremote).'"><br>';
|
print '<input name="xmlremote" class="flat minwidth400" value="'.dol_escape_htmltag($xmlremote).'"><br>';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
|
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
|
||||||
@ -156,7 +156,7 @@ if (GETPOST('target') == 'local') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GETPOST('target') == 'remote') {
|
if (GETPOST('target') == 'remote') {
|
||||||
$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
|
$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php.
|
||||||
|
|
||||||
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
|
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
|
||||||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||||
@ -164,7 +164,7 @@ if (GETPOST('target') == 'remote') {
|
|||||||
//print "xmlfilestart".$xmlfile."xmlfileend";
|
//print "xmlfilestart".$xmlfile."xmlfileend";
|
||||||
$xml = simplexml_load_string($xmlfile);
|
$xml = simplexml_load_string($xmlfile);
|
||||||
} else {
|
} else {
|
||||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||||
setEventMessages($errormsg, null, 'errors');
|
setEventMessages($errormsg, null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,10 +104,10 @@ print '<strong>'.$langs->trans("ApplicativeCache").'</strong>: ';
|
|||||||
$test = !empty($conf->memcached->enabled);
|
$test = !empty($conf->memcached->enabled);
|
||||||
if ($test) {
|
if ($test) {
|
||||||
if (!empty($conf->global->MEMCACHED_SERVER)) {
|
if (!empty($conf->global->MEMCACHED_SERVER)) {
|
||||||
print img_picto('', 'tick.png').' '.$langs->trans("MemcachedAvailableAndSetup");
|
print $langs->trans("MemcachedAvailableAndSetup");
|
||||||
print ' '.$langs->trans("MoreInformation").' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
|
print ' '.$langs->trans("MoreInformation").' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'warning').' '.$langs->trans("MemcachedModuleAvailableButNotSetup");
|
print $langs->trans("MemcachedModuleAvailableButNotSetup");
|
||||||
print ' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
|
print ' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -67,10 +67,10 @@ print "<br>\n";
|
|||||||
print "<br><strong>Web server</strong> - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
|
print "<br><strong>Web server</strong> - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0))."<br>\n";
|
print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
|
||||||
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0))."<br>\n";
|
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath")).')</span>')."<br>\n";
|
||||||
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0))."<br>\n";
|
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||||
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0))."<br>\n";
|
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
|
||||||
print "<strong>PHP disable_functions</strong> = ";
|
print "<strong>PHP disable_functions</strong> = ";
|
||||||
$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions'));
|
$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions'));
|
||||||
$arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals');
|
$arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals');
|
||||||
@ -156,7 +156,7 @@ print '<br>';
|
|||||||
print load_fiche_titre($langs->trans("PermissionsOnFiles"), '', 'folder');
|
print load_fiche_titre($langs->trans("PermissionsOnFiles"), '', 'folder');
|
||||||
|
|
||||||
print '<strong>'.$langs->trans("PermissionsOnFilesInWebRoot").'</strong>: ';
|
print '<strong>'.$langs->trans("PermissionsOnFilesInWebRoot").'</strong>: ';
|
||||||
$arrayoffilesinroot = dol_dir_list(DOL_DOCUMENT_ROOT, 'all', 1, '', array('custom\/'), 'name', SORT_ASC, 4, 1, '', 1);
|
$arrayoffilesinroot = dol_dir_list(DOL_DOCUMENT_ROOT, 'all', 1, '', array('\/custom'), 'name', SORT_ASC, 4, 1, '', 1);
|
||||||
$fileswithwritepermission = array();
|
$fileswithwritepermission = array();
|
||||||
foreach ($arrayoffilesinroot as $fileinroot) {
|
foreach ($arrayoffilesinroot as $fileinroot) {
|
||||||
// Test permission on file
|
// Test permission on file
|
||||||
@ -243,10 +243,13 @@ print '<br>';
|
|||||||
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder');
|
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder');
|
||||||
|
|
||||||
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
|
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
|
||||||
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? $langs->trans("Undefined") : '')." ";
|
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_HASH_ALGO)." ";
|
||||||
print '<span class="opacitymedium"> If unset: \'md5\'</span><br>';
|
if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) {
|
||||||
|
print '<span class="opacitymedium"> If unset: \'md5\'</span>';
|
||||||
|
}
|
||||||
|
print '<br>';
|
||||||
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
||||||
print '<strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? $langs->trans("Undefined") : $conf->global->MAIN_SECURITY_SALT).'<br>';
|
print '<strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_SALT).'<br>';
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
||||||
print '<div class="info">The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.<br>';
|
print '<div class="info">The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.<br>';
|
||||||
@ -258,6 +261,11 @@ if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
|||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."<br>";
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
|
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
|
||||||
print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
|
print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
|
||||||
print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0);
|
print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0);
|
||||||
@ -292,9 +300,10 @@ if (!empty($eventstolog) && is_array($eventstolog)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit"));
|
print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit")).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<br><br>';
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -260,7 +260,7 @@ print "<br>\n";
|
|||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="button">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="button">';
|
||||||
print '<br/><br/>';
|
print '<br><br>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -239,7 +239,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
|||||||
print '<label for="checkbox_use_quick">';
|
print '<label for="checkbox_use_quick">';
|
||||||
print $form->textwithpicto($langs->trans('ExportUseMySQLQuickParameter'), $langs->trans('ExportUseMySQLQuickParameterHelp'));
|
print $form->textwithpicto($langs->trans('ExportUseMySQLQuickParameter'), $langs->trans('ExportUseMySQLQuickParameterHelp'));
|
||||||
print '</label>';
|
print '</label>';
|
||||||
print '<br/>';
|
print '<br>';
|
||||||
|
|
||||||
print '<!-- <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" />';
|
print '<!-- <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" />';
|
||||||
print '<label for="checkbox_drop_database">'.$langs->trans("AddDropDatabase").'</label>';
|
print '<label for="checkbox_drop_database">'.$langs->trans("AddDropDatabase").'</label>';
|
||||||
|
|||||||
@ -289,7 +289,7 @@ if ($mode == 'overwrite') {
|
|||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, $disablededit ? 1 : 0, 'maxwidthonsmartphone', 1);
|
print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, $disablededit ? 1 : 0, 'maxwidth250', 1);
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" class="flat maxwidthonsmartphone"'.$disablededit.' name="transkey" id="transkey" value="'.(!empty($transkey) ? $transkey : "").'">';
|
print '<input type="text" class="flat maxwidthonsmartphone"'.$disablededit.' name="transkey" id="transkey" value="'.(!empty($transkey) ? $transkey : "").'">';
|
||||||
@ -338,7 +338,7 @@ if ($mode == 'overwrite') {
|
|||||||
print '<td>'.$obj->transkey.'</td>'."\n";
|
print '<td>'.$obj->transkey.'</td>'."\n";
|
||||||
|
|
||||||
// Value
|
// Value
|
||||||
print '<td>';
|
print '<td class="small">';
|
||||||
/*print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
|
/*print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
|
||||||
print '<input type="hidden" name="const['.$i.'][lang]" value="'.$obj->lang.'">';
|
print '<input type="hidden" name="const['.$i.'][lang]" value="'.$obj->lang.'">';
|
||||||
print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->transkey.'">';
|
print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->transkey.'">';
|
||||||
@ -482,7 +482,7 @@ if ($mode == 'searchkey') {
|
|||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
|
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
|
||||||
print $formadmin->select_language($langcode, 'langcode', 0, null, 0, 0, 0, 'maxwidthonsmartphone', 1);
|
print $formadmin->select_language($langcode, 'langcode', 0, null, 0, 0, 0, 'maxwidth250', 1);
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" class="flat maxwidthonsmartphone" name="transkey" value="'.$transkey.'">';
|
print '<input type="text" class="flat maxwidthonsmartphone" name="transkey" value="'.$transkey.'">';
|
||||||
@ -529,7 +529,7 @@ if ($mode == 'searchkey') {
|
|||||||
if ($i > ($offset + $limit)) {
|
if ($i > ($offset + $limit)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven"><td>'.$langcode.'</td><td>'.$key.'</td><td>';
|
print '<tr class="oddeven"><td>'.$langcode.'</td><td>'.$key.'</td><td class="small">';
|
||||||
print dol_escape_htmltag($val);
|
print dol_escape_htmltag($val);
|
||||||
print '</td><td class="right nowraponall">';
|
print '</td><td class="right nowraponall">';
|
||||||
if (!empty($newlangfileonly->tab_translate[$key])) {
|
if (!empty($newlangfileonly->tab_translate[$key])) {
|
||||||
|
|||||||
@ -48,8 +48,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$acts[0] = "activate";
|
$acts[0] = "activate";
|
||||||
$acts[1] = "disable";
|
$acts[1] = "disable";
|
||||||
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
@ -490,6 +490,9 @@ if ($id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!isset($obj->position)) {
|
||||||
|
$obj->position = 1;
|
||||||
|
}
|
||||||
|
|
||||||
fieldListWebsites($fieldlist, $obj, $tabname[$id], 'add');
|
fieldListWebsites($fieldlist, $obj, $tabname[$id], 'add');
|
||||||
|
|
||||||
@ -499,8 +502,6 @@ if ($id) {
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$colspan = count($fieldlist) + 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -111,8 +111,8 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
|
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
|
||||||
'family'=>'classify_supplier_proposal',
|
'family'=>'classify_supplier_proposal',
|
||||||
'position'=>60,
|
'position'=>60,
|
||||||
'enabled'=>(!empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||||
'picto'=>'propal',
|
'picto'=>'supplier_proposal',
|
||||||
'warning'=>''
|
'warning'=>''
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -120,8 +120,8 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
|
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
|
||||||
'family'=>'classify_supplier_order',
|
'family'=>'classify_supplier_order',
|
||||||
'position'=>62,
|
'position'=>62,
|
||||||
'enabled'=>(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
|
||||||
'picto'=>'order',
|
'picto'=>'supplier_order',
|
||||||
'warning'=>''
|
'warning'=>''
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -129,8 +129,8 @@ $workflowcodes = array(
|
|||||||
'WORKFLOW_BILL_ON_RECEPTION'=>array(
|
'WORKFLOW_BILL_ON_RECEPTION'=>array(
|
||||||
'family'=>'classify_reception',
|
'family'=>'classify_reception',
|
||||||
'position'=>64,
|
'position'=>64,
|
||||||
'enabled'=>(!empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
'enabled'=>(!empty($conf->reception->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
|
||||||
'picto'=>'bill'
|
'picto'=>'reception'
|
||||||
),
|
),
|
||||||
|
|
||||||
// Automatic classification shipping
|
// Automatic classification shipping
|
||||||
@ -229,7 +229,7 @@ foreach ($workflowcodes as $key => $params) {
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print img_object('', $params['picto']);
|
print img_object('', $params['picto'], 'class="pictofixedwidth"');
|
||||||
print ' '.$langs->trans('desc'.$key);
|
print ' '.$langs->trans('desc'.$key);
|
||||||
|
|
||||||
if (!empty($params['warning'])) {
|
if (!empty($params['warning'])) {
|
||||||
|
|||||||
@ -52,6 +52,28 @@ class Login
|
|||||||
* @throws RestException 500 System error
|
* @throws RestException 500 System error
|
||||||
*
|
*
|
||||||
* @url GET /
|
* @url GET /
|
||||||
|
*/
|
||||||
|
public function loginUnsecured($login, $password, $entity = '', $reset = 0)
|
||||||
|
{
|
||||||
|
return $this->index($login, $password, $entity, $reset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Login
|
||||||
|
*
|
||||||
|
* Request the API token for a couple username / password.
|
||||||
|
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
||||||
|
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: The API token (DOLAPIKEY) can be found/set on the user page.
|
||||||
|
*
|
||||||
|
* @param string $login User login
|
||||||
|
* @param string $password User password
|
||||||
|
* @param string $entity Entity (when multicompany module is used). '' means 1=first company.
|
||||||
|
* @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access)
|
||||||
|
* @return array Response status and user token
|
||||||
|
*
|
||||||
|
* @throws RestException 403 Access denied
|
||||||
|
* @throws RestException 500 System error
|
||||||
|
*
|
||||||
* @url POST /
|
* @url POST /
|
||||||
*/
|
*/
|
||||||
public function index($login, $password, $entity = '', $reset = 0)
|
public function index($login, $password, $entity = '', $reset = 0)
|
||||||
|
|||||||
@ -1661,10 +1661,14 @@ class Setup extends DolibarrApi
|
|||||||
if (empty($xmlremote)) {
|
if (empty($xmlremote)) {
|
||||||
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
||||||
}
|
}
|
||||||
if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) {
|
if ($xmlremote && !preg_match('/^https?:\/\//i', $xmlremote)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
throw new RestException(500, $langs->trans("ErrorURLMustStartWithHttp", $xmlremote));
|
throw new RestException(500, $langs->trans("ErrorURLMustStartWithHttp", $xmlremote));
|
||||||
}
|
}
|
||||||
|
if ($xmlremote && !preg_match('/\.xml$/', $xmlremote)) {
|
||||||
|
$langs->load("errors");
|
||||||
|
throw new RestException(500, $langs->trans("ErrorURLMustEndWith", $xmlremote, '.xml'));
|
||||||
|
}
|
||||||
|
|
||||||
if ($target == 'local') {
|
if ($target == 'local') {
|
||||||
if (dol_is_file($xmlfile)) {
|
if (dol_is_file($xmlfile)) {
|
||||||
@ -1673,7 +1677,7 @@ class Setup extends DolibarrApi
|
|||||||
throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile);
|
throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
|
$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php.
|
||||||
|
|
||||||
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
|
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
|
||||||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||||
@ -1681,7 +1685,7 @@ class Setup extends DolibarrApi
|
|||||||
//print "xmlfilestart".$xmlfile."endxmlfile";
|
//print "xmlfilestart".$xmlfile."endxmlfile";
|
||||||
$xml = simplexml_load_string($xmlfile);
|
$xml = simplexml_load_string($xmlfile);
|
||||||
} else {
|
} else {
|
||||||
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
|
||||||
throw new RestException(500, $errormsg);
|
throw new RestException(500, $errormsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -129,7 +129,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$permission = $user->rights->asset->write;
|
$permission = $user->rights->asset->write;
|
||||||
$permtoedit = $user->rights->asset->write;
|
$permtoedit = $user->rights->asset->write;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -346,11 +346,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($permissiontodelete) {
|
if ($permissiontodelete) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
|
|||||||
@ -151,7 +151,7 @@ if ($object->id) {
|
|||||||
//$relativepathwithnofile='bom/' . dol_sanitizeFileName($object->id).'/';
|
//$relativepathwithnofile='bom/' . dol_sanitizeFileName($object->id).'/';
|
||||||
$relativepathwithnofile = 'bom/'.dol_sanitizeFileName($object->ref).'/';
|
$relativepathwithnofile = 'bom/'.dol_sanitizeFileName($object->ref).'/';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
accessforbidden('', 0, 1);
|
accessforbidden('', 0, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -421,12 +421,12 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
'enable'=>$langs->trans("Enable"),
|
'enable'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Enable"),
|
||||||
'disable'=>$langs->trans("Disable"),
|
'disable'=>img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Disable"),
|
||||||
);
|
);
|
||||||
if ($permissiontodelete) {
|
if ($permissiontodelete) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
|
|||||||
@ -143,13 +143,13 @@ $moreforfilter = '';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'validate'=>$langs->trans("Validate"),
|
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
|
||||||
//'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
//'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
if ($permissiontodelete) {
|
if ($permissiontodelete) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
|
|||||||
@ -37,15 +37,15 @@ function genkeypad($keypadname, $formname)
|
|||||||
$sz .= '<div id="keypad'.$keypadname.'" style="position:absolute;z-index:90;display:none; background:#AAA; vertical-align:top;">'."\n";
|
$sz .= '<div id="keypad'.$keypadname.'" style="position:absolute;z-index:90;display:none; background:#AAA; vertical-align:top;">'."\n";
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 7 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',7);"/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 7 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',7);"/>'."\n";
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 8 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',8);"/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 8 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',8);"/>'."\n";
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 9 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',9);"/><br/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 9 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',9);"/><br>'."\n";
|
||||||
|
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 4 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',4);"/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 4 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',4);"/>'."\n";
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 5 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',5);"/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 5 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',5);"/>'."\n";
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 6 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',6);"/><br/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 6 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',6);"/><br>'."\n";
|
||||||
|
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 1 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',1);"/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 1 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',1);"/>'."\n";
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 2 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',2);"/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 2 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',2);"/>'."\n";
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 3 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',3);"/><br/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 3 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',3);"/><br>'."\n";
|
||||||
|
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 0 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',0);"/>'."\n";
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 0 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',0);"/>'."\n";
|
||||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value="←" ';
|
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value="←" ';
|
||||||
|
|||||||
@ -49,6 +49,8 @@ if (is_numeric($type)) {
|
|||||||
$type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
$type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('categoryindex'));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
*/
|
*/
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncommreminder.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncommreminder.class.php';
|
||||||
|
|
||||||
@ -2290,14 +2289,16 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
//Select all action comm reminder
|
//Select all action comm reminders
|
||||||
$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
|
$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
|
||||||
$sql .= " WHERE typeremind = 'email' AND status = 0";
|
$sql .= " WHERE typeremind = 'email' AND status = 0";
|
||||||
$sql .= " AND dateremind <= '".$this->db->idate(dol_now())."'";
|
$sql .= " AND dateremind <= '".$this->db->idate($now)."'";
|
||||||
|
$sql .= " AND entity IN (".getEntity('actioncomm').")";
|
||||||
$sql .= $this->db->order("dateremind", "ASC");
|
$sql .= $this->db->order("dateremind", "ASC");
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($this->db);
|
$formmail = new FormMail($this->db);
|
||||||
|
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -201,10 +201,10 @@ class CActionComm
|
|||||||
if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) {
|
if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) {
|
||||||
$qualified = 0;
|
$qualified = 0;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled)) && empty($user->fournisseur->facture->lire)) {
|
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->facture->lire)) || (!empty($conf->supplier_invoice->enabled) && empty($user->supplier_invoice->lire)))) {
|
||||||
$qualified = 0;
|
$qualified = 0;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled)) && empty($user->fournisseur->commande->lire)) {
|
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->commande->lire)) || (empty($conf->supplier_order->enabled) && empty($user->supplier_order->lire)))) {
|
||||||
$qualified = 0;
|
$qualified = 0;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) {
|
if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) {
|
||||||
|
|||||||
@ -287,7 +287,7 @@ if ($object->id > 0) {
|
|||||||
$modulepart = 'actions';
|
$modulepart = 'actions';
|
||||||
$permission = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create;
|
$permission = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -355,10 +355,10 @@ $arrayofmassactions = array(
|
|||||||
'set_all_events_to_finished' => $langs->trans("SetAllEventsToFinished"),
|
'set_all_events_to_finished' => $langs->trans("SetAllEventsToFinished"),
|
||||||
);
|
);
|
||||||
if ($user->rights->agenda->allactions->delete) {
|
if ($user->rights->agenda->allactions->delete) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if ($user->rights->agenda->myactions->create) {
|
if ($user->rights->agenda->myactions->create) {
|
||||||
$arrayofmassactions['preaffecttag'] = '<span class="fa fa-tag paddingrightonly"></span>'.$langs->trans("AffectTag");
|
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||||
}
|
}
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
|
|||||||
@ -90,7 +90,7 @@ if (!empty($conf->supplier_proposal->enabled)) {
|
|||||||
if (!empty($conf->commande->enabled)) {
|
if (!empty($conf->commande->enabled)) {
|
||||||
$orderstatic = new Commande($db);
|
$orderstatic = new Commande($db);
|
||||||
}
|
}
|
||||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||||
$supplierorderstatic = new CommandeFournisseur($db);
|
$supplierorderstatic = new CommandeFournisseur($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
|||||||
/*
|
/*
|
||||||
* Draft purchase orders
|
* Draft purchase orders
|
||||||
*/
|
*/
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
|
||||||
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
|
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
|
||||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||||
@ -588,7 +588,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
|||||||
/*
|
/*
|
||||||
* Last suppliers
|
* Last suppliers
|
||||||
*/
|
*/
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) {
|
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) {
|
||||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||||
@ -647,7 +647,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
|||||||
{
|
{
|
||||||
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>';
|
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>';
|
||||||
}*/
|
}*/
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) {
|
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) {
|
||||||
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
|
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
|
||||||
}
|
}
|
||||||
print $s;
|
print $s;
|
||||||
|
|||||||
@ -678,8 +678,9 @@ if ($object->fetch($id) >= 0) {
|
|||||||
|
|
||||||
// Search Icon
|
// Search Icon
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
|
print '<!-- ID mailing_cibles = '.$obj->rowid.' -->';
|
||||||
if ($obj->statut == 0) { // Not sent yet
|
if ($obj->statut == 0) { // Not sent yet
|
||||||
if ($user->rights->mailing->creer && $allowaddtarget) {
|
if (!empty($user->rights->mailing->creer) && $allowaddtarget) {
|
||||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
|
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -614,7 +614,7 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
}
|
}
|
||||||
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
||||||
if ($arrayquery['options_'.$key] != '') {
|
if ($arrayquery['options_'.$key] != '') {
|
||||||
$sqlwhere[] = " (te.".$key." = ".$arrayquery['options_'.$key].")";
|
$sqlwhere[] = " (te.".$key." = ".((int) $arrayquery['options_'.$key]).")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (is_array($arrayquery['options_'.$key])) {
|
if (is_array($arrayquery['options_'.$key])) {
|
||||||
|
|||||||
@ -122,7 +122,7 @@ $usercancreateorder = $user->rights->commande->creer;
|
|||||||
$usercancreateinvoice = $user->rights->facture->creer;
|
$usercancreateinvoice = $user->rights->facture->creer;
|
||||||
$usercancreatecontract = $user->rights->contrat->creer;
|
$usercancreatecontract = $user->rights->contrat->creer;
|
||||||
$usercancreateintervention = $user->rights->ficheinter->creer;
|
$usercancreateintervention = $user->rights->ficheinter->creer;
|
||||||
$usercancreatepurchaseorder = $user->rights->fournisseur->commande->creer;
|
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||||
|
|
||||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||||
@ -623,7 +623,7 @@ if (empty($reshook)) {
|
|||||||
// Classify billed
|
// Classify billed
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$result = $object->cloture($user, $object::STATUS_BILLED, '');
|
$result = $object->classifyBilled($user, 0, '');
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -639,12 +639,12 @@ if (empty($reshook)) {
|
|||||||
if (!(GETPOST('statut', 'int') > 0)) {
|
if (!(GETPOST('statut', 'int') > 0)) {
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
|
||||||
$action = 'closeas';
|
$action = 'closeas';
|
||||||
} else {
|
} elseif (GETPOST('statut', 'int') == $object::STATUS_SIGNED || GETPOST('statut', 'int') == $object::STATUS_NOTSIGNED) {
|
||||||
// prevent browser refresh from closing proposal several times
|
// prevent browser refresh from closing proposal several times
|
||||||
if ($object->statut == $object::STATUS_VALIDATED) {
|
if ($object->statut == $object::STATUS_VALIDATED) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$result = $object->signature($user, GETPOST('statut', 'int'), GETPOST('note_private', 'restricthtml'));
|
$result = $object->closeProposal($user, GETPOST('statut', 'int'), GETPOST('note_private', 'restricthtml'));
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -2534,7 +2534,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Create a purchase order
|
// Create a purchase order
|
||||||
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) {
|
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) {
|
||||||
if (!empty($conf->fournisseur->enabled) && $object->statut == Propal::STATUS_SIGNED) {
|
if ($object->statut == Propal::STATUS_SIGNED && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) {
|
||||||
if ($usercancreatepurchaseorder) {
|
if ($usercancreatepurchaseorder) {
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>';
|
||||||
}
|
}
|
||||||
@ -2633,12 +2633,6 @@ if ($action == 'create') {
|
|||||||
print showOnlineSignatureUrl('proposal', $object->ref).'<br>';
|
print showOnlineSignatureUrl('proposal', $object->ref).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show direct download link
|
|
||||||
if ($object->statut != Propal::STATUS_DRAFT && !empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) {
|
|
||||||
print '<br><!-- Link to download main doc -->'."\n";
|
|
||||||
print showDirectDownloadLink($object).'<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
|
|||||||
@ -766,7 +766,7 @@ class Proposals extends DolibarrApi
|
|||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->propal->cloture(DolibarrApiAccess::$user, $status, $note_private, $notrigger);
|
$result = $this->propal->closeProposal(DolibarrApiAccess::$user, $status, $note_private, $notrigger);
|
||||||
if ($result == 0) {
|
if ($result == 0) {
|
||||||
throw new RestException(304, 'Error nothing done. May be object is already closed');
|
throw new RestException(304, 'Error nothing done. May be object is already closed');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,6 +118,13 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $statut;
|
public $statut;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Status of the quote
|
||||||
|
* @var int
|
||||||
|
* @see Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED
|
||||||
|
*/
|
||||||
|
public $status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @see $date_creation
|
* @see $date_creation
|
||||||
@ -2502,15 +2509,15 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sign the commercial proposal
|
* Close/set the commercial proposal to status signed or refused (fill also date signature)
|
||||||
*
|
*
|
||||||
* @param User $user Object user that close
|
* @param User $user Object user that close
|
||||||
* @param int $statut Status
|
* @param int $status Status (self::STATUS_BILLED or self::STATUS_REFUSED)
|
||||||
* @param string $note Complete private note with this note
|
* @param string $note Complete private note with this note
|
||||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function signature($user, $statut, $note = '', $notrigger = 0)
|
public function closeProposal($user, $status, $note = '', $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
@ -2522,15 +2529,16 @@ class Propal extends CommonObject
|
|||||||
$newprivatenote = dol_concatdesc($this->note_private, $note);
|
$newprivatenote = dol_concatdesc($this->note_private, $note);
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||||
$sql .= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id;
|
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id;
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
// Status self::STATUS_REFUSED by default
|
||||||
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
|
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
|
||||||
$trigger_name = 'PROPAL_CLOSE_REFUSED';
|
$trigger_name = 'PROPAL_CLOSE_REFUSED';
|
||||||
|
|
||||||
if ($statut == self::STATUS_SIGNED) {
|
if ($status == self::STATUS_SIGNED) { // Status self::STATUS_SIGNED
|
||||||
$trigger_name = 'PROPAL_CLOSE_SIGNED';
|
$trigger_name = 'PROPAL_CLOSE_SIGNED';
|
||||||
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->model_pdf;
|
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->model_pdf;
|
||||||
|
|
||||||
@ -2561,7 +2569,8 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->oldcopy= clone $this;
|
$this->oldcopy= clone $this;
|
||||||
$this->statut = $statut;
|
$this->statut = $status;
|
||||||
|
$this->status = $status;
|
||||||
$this->date_signature = $now;
|
$this->date_signature = $now;
|
||||||
$this->note_private = $newprivatenote;
|
$this->note_private = $newprivatenote;
|
||||||
}
|
}
|
||||||
@ -2580,6 +2589,7 @@ class Propal extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$this->statut = $this->oldcopy->statut;
|
$this->statut = $this->oldcopy->statut;
|
||||||
|
$this->status = $this->oldcopy->statut;
|
||||||
$this->date_signature = $this->oldcopy->date_signature;
|
$this->date_signature = $this->oldcopy->date_signature;
|
||||||
$this->note_private = $this->oldcopy->note_private;
|
$this->note_private = $this->oldcopy->note_private;
|
||||||
|
|
||||||
@ -2587,59 +2597,50 @@ class Propal extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->error=$this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the commercial proposal
|
* Classify the proposal to status Billed
|
||||||
*
|
*
|
||||||
* @param User $user Object user that close
|
* @param User $user Object user
|
||||||
* @param int $status Status
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @param string $note Complete private note with this note
|
* @param string $note Complete private note with this note
|
||||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
* @return int <0 if KO, 0 = nothing done, >0 if OK
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
*/
|
||||||
public function cloture($user, $status, $note = "", $notrigger = 0)
|
public function classifyBilled(User $user, $notrigger = 0, $note = '')
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $conf, $langs;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
$num = 0;
|
||||||
|
|
||||||
|
$triggerName = 'PROPAL_CLASSIFY_BILLED';
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$newprivatenote = dol_concatdesc($this->note_private, $note);
|
$newprivatenote = dol_concatdesc($this->note_private, $note);
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET fk_statut = '.self::STATUS_BILLED.", ";
|
||||||
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id;
|
$sql .= " note_private = '".$this->db->escape($newprivatenote)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id;
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut = '.self::STATUS_SIGNED;
|
||||||
|
|
||||||
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if (!$resql) {
|
||||||
|
$this->errors[] = $this->db->error();
|
||||||
|
$error++;
|
||||||
|
} else {
|
||||||
|
$num = $this->db->affected_rows($resql);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
|
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
|
||||||
$triggerName = 'PROPAL_CLOSE_REFUSED';
|
|
||||||
|
|
||||||
if ($status == self::STATUS_SIGNED) {
|
|
||||||
$triggerName = 'PROPAL_CLOSE_SIGNED';
|
|
||||||
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf;
|
|
||||||
|
|
||||||
// The connected company is classified as a client
|
|
||||||
$soc = new Societe($this->db);
|
|
||||||
$soc->id = $this->socid;
|
|
||||||
$result = $soc->set_as_client();
|
|
||||||
|
|
||||||
if ($result < 0) {
|
|
||||||
$this->error = $this->db->lasterror();
|
|
||||||
$this->db->rollback();
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($status == self::STATUS_BILLED) { // ->cloture() can also be called when we set it to billed, after setting it to signed
|
|
||||||
$triggerName = 'PROPAL_CLASSIFY_BILLED';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -2649,13 +2650,13 @@ class Propal extends CommonObject
|
|||||||
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
|
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
|
|
||||||
//$ret=$object->fetch($id); // Reload to get new records
|
//$ret=$object->fetch($id); // Reload to get new records
|
||||||
$this->generateDocument($modelpdf, $outputlangs);
|
$this->generateDocument($modelpdf, $outputlangs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$this->oldcopy = clone $this;
|
$this->oldcopy = clone $this;
|
||||||
$this->statut = $status;
|
$this->statut = self::STATUS_BILLED;
|
||||||
$this->date_cloture = $now;
|
$this->date_cloture = $now;
|
||||||
$this->note_private = $newprivatenote;
|
$this->note_private = $newprivatenote;
|
||||||
}
|
}
|
||||||
@ -2671,62 +2672,7 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return $num;
|
||||||
} else {
|
|
||||||
$this->statut = $this->oldcopy->statut;
|
|
||||||
$this->date_cloture = $this->oldcopy->date_cloture;
|
|
||||||
$this->note_private = $this->oldcopy->note_private;
|
|
||||||
|
|
||||||
$this->db->rollback();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$this->error = $this->db->lasterror();
|
|
||||||
$this->db->rollback();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class invoiced the Propal
|
|
||||||
*
|
|
||||||
* @param User $user Object user
|
|
||||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
|
||||||
* @return int <0 si ko, >0 si ok
|
|
||||||
*/
|
|
||||||
public function classifyBilled(User $user, $notrigger = 0)
|
|
||||||
{
|
|
||||||
$error = 0;
|
|
||||||
|
|
||||||
$this->db->begin();
|
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET fk_statut = '.self::STATUS_BILLED;
|
|
||||||
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT;
|
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if (!$resql) {
|
|
||||||
$this->errors[] = $this->db->error();
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$this->oldcopy = clone $this;
|
|
||||||
$this->statut = self::STATUS_BILLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$notrigger && empty($error)) {
|
|
||||||
// Call trigger
|
|
||||||
$result = $this->call_trigger('PROPAL_MODIFY', $user);
|
|
||||||
if ($result < 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
// End call triggers
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$this->db->commit();
|
|
||||||
return 1;
|
|
||||||
} else {
|
} else {
|
||||||
foreach ($this->errors as $errmsg) {
|
foreach ($this->errors as $errmsg) {
|
||||||
dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR);
|
dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR);
|
||||||
@ -2922,7 +2868,7 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count($linkedInvoices) > 0) {
|
if (count($linkedInvoices) > 0) {
|
||||||
$sql = "SELECT rowid as facid, ref, total, datef as df, fk_user_author, fk_statut, paye";
|
$sql = "SELECT rowid as facid, ref, total_ht as total, datef as df, fk_user_author, fk_statut, paye";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture";
|
||||||
$sql .= " WHERE rowid IN (".$this->db->sanitize(implode(',', $linkedInvoices)).")";
|
$sql .= " WHERE rowid IN (".$this->db->sanitize(implode(',', $linkedInvoices)).")";
|
||||||
|
|
||||||
|
|||||||
@ -189,7 +189,7 @@ if ($object->id > 0) {
|
|||||||
$permission = $user->rights->propal->creer;
|
$permission = $user->rights->propal->creer;
|
||||||
$permtoedit = $user->rights->propal->creer;
|
$permtoedit = $user->rights->propal->creer;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
|
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -73,6 +74,7 @@ $search_societe_alias = GETPOST('search_societe_alias', 'alpha');
|
|||||||
$search_montant_ht = GETPOST('search_montant_ht', 'alpha');
|
$search_montant_ht = GETPOST('search_montant_ht', 'alpha');
|
||||||
$search_montant_vat = GETPOST('search_montant_vat', 'alpha');
|
$search_montant_vat = GETPOST('search_montant_vat', 'alpha');
|
||||||
$search_montant_ttc = GETPOST('search_montant_ttc', 'alpha');
|
$search_montant_ttc = GETPOST('search_montant_ttc', 'alpha');
|
||||||
|
$search_warehouse = GETPOST('search_warehouse', 'alpha');
|
||||||
$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
|
$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
|
||||||
$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
|
$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
|
||||||
$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
|
$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
|
||||||
@ -125,11 +127,6 @@ if (!$sortorder) {
|
|||||||
$sortorder = 'DESC';
|
$sortorder = 'DESC';
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissiontoread = $user->rights->propal->lire;
|
|
||||||
$permissiontoadd = $user->rights->propal->write;
|
|
||||||
$permissiontodelete = $user->rights->propal->supprimer;
|
|
||||||
$permissiontoclose = $user->rights->propal->cloturer;
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$module = 'propal';
|
$module = 'propal';
|
||||||
$dbtable = '';
|
$dbtable = '';
|
||||||
@ -218,6 +215,20 @@ $arrayfields = array(
|
|||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||||
|
|
||||||
|
$permissiontoread = $user->rights->propal->lire;
|
||||||
|
$permissiontoadd = $user->rights->propal->write;
|
||||||
|
$permissiontodelete = $user->rights->propal->supprimer;
|
||||||
|
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||||
|
$permissiontovalidate = $user->rights->propale->propal_advance->validate;
|
||||||
|
$permissiontoclose = $user->rights->propale->propal_advance->close;
|
||||||
|
$permissiontosendbymail = $user->rights->propale->propal_advance->send;
|
||||||
|
} else {
|
||||||
|
$permissiontovalidate = $user->rights->propal->write;
|
||||||
|
$permissiontoclose = $user->rights->propal->write;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -253,6 +264,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$search_montant_ht = '';
|
$search_montant_ht = '';
|
||||||
$search_montant_vat = '';
|
$search_montant_vat = '';
|
||||||
$search_montant_ttc = '';
|
$search_montant_ttc = '';
|
||||||
|
$search_warehouse = '';
|
||||||
$search_multicurrency_code = '';
|
$search_multicurrency_code = '';
|
||||||
$search_multicurrency_tx = '';
|
$search_multicurrency_tx = '';
|
||||||
$search_multicurrency_montant_ht = '';
|
$search_multicurrency_montant_ht = '';
|
||||||
@ -295,7 +307,7 @@ if (empty($reshook)) {
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'validate') {
|
if ($action == 'validate' && $permissiontovalidate) {
|
||||||
if (GETPOST('confirm') == 'yes') {
|
if (GETPOST('confirm') == 'yes') {
|
||||||
$tmpproposal = new Propal($db);
|
$tmpproposal = new Propal($db);
|
||||||
$db->begin();
|
$db->begin();
|
||||||
@ -313,10 +325,11 @@ if ($action == 'validate') {
|
|||||||
setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors');
|
setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
} else {
|
} else {
|
||||||
@ -325,16 +338,16 @@ if ($action == 'validate') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "sign") {
|
if ($action == "sign" && $permissiontoclose) {
|
||||||
if (GETPOST('confirm') == 'yes') {
|
if (GETPOST('confirm') == 'yes') {
|
||||||
$tmpproposal = new Propal($db);
|
$tmpproposal = new Propal($db);
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ($toselect as $checked) {
|
foreach ($toselect as $checked) {
|
||||||
if ($tmpproposal->fetch($checked)) {
|
if ($tmpproposal->fetch($checked)) {
|
||||||
if ($tmpproposal->statut == 1) {
|
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
||||||
$tmpproposal->statut = 2;
|
$tmpproposal->statut = $tmpproposal::STATUS_SIGNED;;
|
||||||
if ($tmpproposal->update($user)) {
|
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED)) {
|
||||||
setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
|
setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -356,16 +369,16 @@ if ($action == "sign") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($action == "nosign") {
|
if ($action == "nosign" && $permissiontoclose) {
|
||||||
if (GETPOST('confirm') == 'yes') {
|
if (GETPOST('confirm') == 'yes') {
|
||||||
$tmpproposal = new Propal($db);
|
$tmpproposal = new Propal($db);
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ($toselect as $checked) {
|
foreach ($toselect as $checked) {
|
||||||
if ($tmpproposal->fetch($checked)) {
|
if ($tmpproposal->fetch($checked)) {
|
||||||
if ($tmpproposal->statut == 1) {
|
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
||||||
$tmpproposal->statut = 3;
|
$tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED;
|
||||||
if ($tmpproposal->update($user)) {
|
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED)) {
|
||||||
setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs');
|
setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -388,6 +401,43 @@ if ($action == "nosign") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Closed records
|
||||||
|
if (!$error && $massaction === 'setbilled' && $permissiontoclose) {
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
$objecttmp = new $objectclass($db);
|
||||||
|
$nbok = 0;
|
||||||
|
foreach ($toselect as $toselectid) {
|
||||||
|
$result = $objecttmp->fetch($toselectid);
|
||||||
|
if ($result > 0) {
|
||||||
|
$result = $objecttmp->classifyBilled($user, 0);
|
||||||
|
if ($result <= 0) {
|
||||||
|
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||||
|
$error++;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
$nbok++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||||
|
$error++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
if ($nbok > 1) {
|
||||||
|
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
|
||||||
|
}
|
||||||
|
$db->commit();
|
||||||
|
} else {
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -520,6 +570,9 @@ if ($search_montant_vat != '') {
|
|||||||
if ($search_montant_ttc != '') {
|
if ($search_montant_ttc != '') {
|
||||||
$sql .= natural_search("p.total_ttc", $search_montant_ttc, 1);
|
$sql .= natural_search("p.total_ttc", $search_montant_ttc, 1);
|
||||||
}
|
}
|
||||||
|
if ($search_warehouse != '' && $search_warehouse > 0) {
|
||||||
|
$sql .= natural_search("p.fk_warehouse", $search_warehouse, 1);
|
||||||
|
}
|
||||||
if ($search_multicurrency_code != '') {
|
if ($search_multicurrency_code != '') {
|
||||||
$sql .= ' AND p.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"';
|
$sql .= ' AND p.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"';
|
||||||
}
|
}
|
||||||
@ -772,19 +825,25 @@ if ($resql) {
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
'generate_doc'=>img_picto('', 'pdf').' '.$langs->trans("ReGeneratePDF"),
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>img_picto('', 'pdf').' '.$langs->trans("PDFMerge"),
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
|
||||||
'prevalidate'=>$langs->trans("Validate"),
|
|
||||||
'presign'=>$langs->trans("Sign"),
|
|
||||||
'nopresign'=>$langs->trans("NoSign"),
|
|
||||||
);
|
);
|
||||||
if ($user->rights->propal->supprimer) {
|
if ($permissiontosendbymail) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['presend']=img_picto('', 'email').' '.$langs->trans("SendByMail");
|
||||||
}
|
}
|
||||||
if ($user->rights->propal->cloturer) {
|
if ($permissiontovalidate) {
|
||||||
$arrayofmassactions['closed'] = $langs->trans("Close");
|
$arrayofmassactions['prevalidate']=img_picto('', 'check').' '.$langs->trans("Validate");
|
||||||
}
|
}
|
||||||
|
if ($permissiontoclose) {
|
||||||
|
$arrayofmassactions['presign']=img_picto('', 'propal').' '.$langs->trans("Sign");
|
||||||
|
$arrayofmassactions['nopresign']=img_picto('', 'propal').' '.$langs->trans("NoSign");
|
||||||
|
$arrayofmassactions['setbilled'] =img_picto('', 'bill').' '.$langs->trans("ClassifyBilled");
|
||||||
|
}
|
||||||
|
if ($permissiontodelete) {
|
||||||
|
$arrayofmassactions['predelete'] = img_picto('', 'delete').' '.$langs->trans("Delete");
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array($massaction, array('presend', 'predelete', 'closed'))) {
|
if (in_array($massaction, array('presend', 'predelete', 'closed'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
@ -870,6 +929,14 @@ if ($resql) {
|
|||||||
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle);
|
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
|
if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
|
$formproduct = new FormProduct($db);
|
||||||
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
|
$tmptitle = $langs->trans('Warehouse');
|
||||||
|
$moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', $tmptitle, 0, 0, $tmptitle);
|
||||||
|
$moreforfilter .= '</div>';
|
||||||
|
}
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
|
|||||||
@ -114,7 +114,7 @@ $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancr
|
|||||||
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
|
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
|
||||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
|
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
|
||||||
|
|
||||||
$usercancreatepurchaseorder = $user->rights->fournisseur->commande->creer;
|
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||||
|
|
||||||
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||||
@ -2501,7 +2501,7 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
|
|
||||||
// Create a purchase order
|
// Create a purchase order
|
||||||
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_SALE_ORDER)) {
|
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_SALE_ORDER)) {
|
||||||
if (!empty($conf->fournisseur->enabled) && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
|
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
|
||||||
if ($usercancreatepurchaseorder) {
|
if ($usercancreatepurchaseorder) {
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>';
|
||||||
}
|
}
|
||||||
@ -2629,12 +2629,6 @@ if ($action == 'create' && $usercancreate) {
|
|||||||
print showOnlinePaymentUrl('order', $object->ref).'<br>';
|
print showOnlinePaymentUrl('order', $object->ref).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show direct download link
|
|
||||||
if ($object->statut != Commande::STATUS_DRAFT && !empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) {
|
|
||||||
print '<br><!-- Link to download main doc -->'."\n";
|
|
||||||
print showDirectDownloadLink($object).'<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
|
|||||||
@ -88,7 +88,7 @@ if ($action == 'addcontact' && $user->rights->commande->creer) {
|
|||||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -184,7 +184,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$permission = $user->rights->commande->creer;
|
$permission = $user->rights->commande->creer;
|
||||||
$permtoedit = $user->rights->commande->creer;
|
$permtoedit = $user->rights->commande->creer;
|
||||||
$param = '&id='.$object->id.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity);
|
$param = '&id='.$object->id.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -452,7 +452,7 @@ if ($search_total_vat != '') {
|
|||||||
if ($search_total_ttc != '') {
|
if ($search_total_ttc != '') {
|
||||||
$sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
|
$sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
|
||||||
}
|
}
|
||||||
if ($search_warehouse != '' && $search_warehouse != '-1') {
|
if ($search_warehouse != '' && $search_warehouse > 0) {
|
||||||
$sql .= natural_search('c.fk_warehouse', $search_warehouse, 1);
|
$sql .= natural_search('c.fk_warehouse', $search_warehouse, 1);
|
||||||
}
|
}
|
||||||
if ($search_multicurrency_code != '') {
|
if ($search_multicurrency_code != '') {
|
||||||
@ -838,7 +838,7 @@ if ($resql) {
|
|||||||
$formproduct = new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$tmptitle = $langs->trans('Warehouse');
|
$tmptitle = $langs->trans('Warehouse');
|
||||||
$moreforfilter .= img_picto($tmptitle, 'warehouse', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', $tmptitle);
|
$moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, $tmptitle);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
}
|
}
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
@ -1631,7 +1631,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
$stock_order = $generic_product->stats_commande['qty'];
|
$stock_order = $generic_product->stats_commande['qty'];
|
||||||
}
|
}
|
||||||
if (!empty($conf->fournisseur->enabled)) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||||
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
|
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
|
||||||
$generic_product->load_stats_commande_fournisseur(0, '3');
|
$generic_product->load_stats_commande_fournisseur(0, '3');
|
||||||
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
|
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
|
||||||
@ -1653,7 +1653,7 @@ if ($resql) {
|
|||||||
} else {
|
} else {
|
||||||
$text_info .= '<span class="ok">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
$text_info .= '<span class="ok">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||||
}
|
}
|
||||||
if (!empty($conf->fournisseur->enabled)) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
|
||||||
$text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'<br>';
|
$text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'<br>';
|
||||||
} else {
|
} else {
|
||||||
$text_info .= '<br>';
|
$text_info .= '<br>';
|
||||||
|
|||||||
@ -188,7 +188,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$param = '&id='.$object->id.'&num='.urlencode($numref);
|
$param = '&id='.$object->id.'&num='.urlencode($numref);
|
||||||
$moreparam = '&num='.urlencode($numref);
|
$moreparam = '&num='.urlencode($numref);
|
||||||
$relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($numref)."/";
|
$relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($numref)."/";
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -736,10 +736,10 @@ if ($resql) {
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if ($user->rights->bank->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
//if ($user->rights->bank->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
if (in_array($massaction, array('presend', 'predelete'))) {
|
if (in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -385,7 +385,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("BankAccountCountry").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("BankAccountCountry").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->select_country($selectedcode, 'account_country_id');
|
print img_picto('', 'country', 'class="pictofixedwidth"').$form->select_country($selectedcode, 'account_country_id');
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
}
|
}
|
||||||
@ -883,7 +883,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Country").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Country").'</td>';
|
||||||
print '<td class="maxwidth200onsmartphone">';
|
print '<td class="maxwidth200onsmartphone">';
|
||||||
print $form->select_country($selectedcode, 'account_country_id');
|
print img_picto('', 'country', 'class="pictofixedwidth"').$form->select_country($selectedcode, 'account_country_id');
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$permission = $user->rights->banque->modifier;
|
$permission = $user->rights->banque->modifier;
|
||||||
$permtoedit = $user->rights->banque->modifier;
|
$permtoedit = $user->rights->banque->modifier;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,8 +95,8 @@ if (!$sortorder) {
|
|||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$object = new Account($db);
|
$object = new Account($db);
|
||||||
$hookmanager->initHooks(array('bankaccountlist'));
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
$hookmanager->initHooks(array('bankaccountlist'));
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
@ -129,6 +129,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
|||||||
$object->fields = dol_sort_array($object->fields, 'position');
|
$object->fields = dol_sort_array($object->fields, 'position');
|
||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
|
$permissiontoadd = $user->rights->banque->modifier;
|
||||||
|
$permissiontodelete = $user->rights->banque->supprimer;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -162,7 +164,6 @@ if (empty($reshook)) {
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'Account';
|
$objectclass = 'Account';
|
||||||
$objectlabel = 'FinancialAccount';
|
$objectlabel = 'FinancialAccount';
|
||||||
$permissiontoadd = $user->rights->banque->modifier;
|
|
||||||
$uploaddir = $conf->banque->dir_output;
|
$uploaddir = $conf->banque->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
@ -287,27 +288,28 @@ if ($optioncss != '') {
|
|||||||
}
|
}
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
// Add $param from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
// 'presend'=>$langs->trans("SendByMail"),
|
// 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
// 'builddoc'=>$langs->trans("PDFMerge"),
|
// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
if ($user->rights->banque->supprimer) {
|
if ($permissiontodelete) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if ($user->rights->banque->modifier) {
|
if ($user->rights->banque->modifier) {
|
||||||
$arrayofmassactions['preaffecttag'] = '<span class="fa fa-tag paddingrightonly"></span>'.$langs->trans("AffectTag");
|
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||||
}
|
}
|
||||||
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewFinancialAccount'), '', 'fa fa-plus-circle', 'card.php?action=create', '', $user->rights->banque->configurer);
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
|
|
||||||
// Lines of title fields
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
|
||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
}
|
}
|
||||||
@ -316,9 +318,13 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
|||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="search_status" value="'.$search_status.'">';
|
print '<input type="hidden" name="search_status" value="'.$search_status.'">';
|
||||||
|
|
||||||
|
$newcardbutton = dolGetButtonTitle($langs->trans('NewFinancialAccount'), '', 'fa fa-plus-circle', 'card.php?action=create', '', $user->rights->banque->configurer);
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit, 1);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit, 1);
|
||||||
|
|
||||||
$topicmail = "Information";
|
$topicmail = "Information";
|
||||||
@ -342,7 +348,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
|||||||
|
|
||||||
// Bank accounts
|
// Bank accounts
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$moreforfilter .= $hookmanager->resPrint;
|
$moreforfilter .= $hookmanager->resPrint;
|
||||||
} else {
|
} else {
|
||||||
@ -357,11 +363,14 @@ if (!empty($moreforfilter)) {
|
|||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre_filter">';
|
// Fields title search
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
if (!empty($arrayfields['b.ref']['checked'])) {
|
if (!empty($arrayfields['b.ref']['checked'])) {
|
||||||
@ -411,7 +420,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
|||||||
|
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields);
|
$parameters = array('arrayfields'=>$arrayfields);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
// Date creation
|
// Date creation
|
||||||
if (!empty($arrayfields['b.datec']['checked'])) {
|
if (!empty($arrayfields['b.datec']['checked'])) {
|
||||||
@ -438,13 +447,14 @@ if (!empty($arrayfields['balance']['checked'])) {
|
|||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
}
|
}
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="liste_titre valignmiddle">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
$searchpicto = $form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Fields title
|
// Fields title label
|
||||||
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($arrayfields['b.ref']['checked'])) {
|
if (!empty($arrayfields['b.ref']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['b.ref']['label'], $_SERVER["PHP_SELF"], 'b.ref', '', $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['b.ref']['label'], $_SERVER["PHP_SELF"], 'b.ref', '', $param, '', $sortfield, $sortorder);
|
||||||
@ -672,7 +682,9 @@ foreach ($accounts as $key => $type) {
|
|||||||
// Balance
|
// Balance
|
||||||
if (!empty($arrayfields['balance']['checked'])) {
|
if (!empty($arrayfields['balance']['checked'])) {
|
||||||
print '<td class="nowraponall right">';
|
print '<td class="nowraponall right">';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$objecttmp->id.'">'.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$objecttmp->id.'">';
|
||||||
|
print '<span class="amount">'.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).'</span>';
|
||||||
|
print '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
|
|||||||
@ -269,10 +269,12 @@ print '<td style="display:none" class="multicurrency">'.$langs->trans("AmountToO
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
|
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||||
$form->select_comptes($account_from, 'account_from', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1);
|
$form->select_comptes($account_from, 'account_from', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td>\n";
|
print "<td>\n";
|
||||||
|
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||||
$form->select_comptes($account_to, 'account_to', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1);
|
$form->select_comptes($account_to, 'account_to', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
|
|||||||
@ -152,7 +152,7 @@ if ($object->id) {
|
|||||||
$modulepart = 'banque';
|
$modulepart = 'banque';
|
||||||
$permission = $user->rights->banque->modifier;
|
$permission = $user->rights->banque->modifier;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -379,10 +379,10 @@ $param .= $hookmanager->resPrint;
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
//'presend'=>$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if ($user->rights->monmodule->delete) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
//if ($user->rights->monmodule->delete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,6 +41,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php'
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
|
|
||||||
$langs->loadLangs(array("bills", "banks"));
|
$langs->loadLangs(array("bills", "banks"));
|
||||||
|
|
||||||
@ -267,7 +269,7 @@ if ($resql) {
|
|||||||
// Debit
|
// Debit
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($objp->amount < 0) {
|
if ($objp->amount < 0) {
|
||||||
print price($objp->amount * -1);
|
print '<span class="amount">'.price($objp->amount * -1).'</span>';
|
||||||
$totalarray['val']['totaldebfield'] += $objp->amount;
|
$totalarray['val']['totaldebfield'] += $objp->amount;
|
||||||
$amountpertype[$objp->code] += $objp->amount;
|
$amountpertype[$objp->code] += $objp->amount;
|
||||||
}
|
}
|
||||||
@ -282,7 +284,7 @@ if ($resql) {
|
|||||||
// Credit
|
// Credit
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($objp->amount > 0) {
|
if ($objp->amount > 0) {
|
||||||
print price($objp->amount);
|
print '<span class="amount">'.price($objp->amount).'</span>';
|
||||||
$totalarray['val']['totalcredfield'] += $objp->amount;
|
$totalarray['val']['totalcredfield'] += $objp->amount;
|
||||||
$amountpertype[$objp->code] -= $objp->amount;
|
$amountpertype[$objp->code] -= $objp->amount;
|
||||||
}
|
}
|
||||||
@ -307,7 +309,7 @@ if ($resql) {
|
|||||||
//$cash = $amountpertype['LIQ'] + $cashcontrol->opening;
|
//$cash = $amountpertype['LIQ'] + $cashcontrol->opening;
|
||||||
$cash = price2num($cash + $cashcontrol->opening, 'MT');
|
$cash = price2num($cash + $cashcontrol->opening, 'MT');
|
||||||
|
|
||||||
print "<div style='text-align: right'><h2>";
|
print '<div style="text-align: right"><h2>';
|
||||||
print $langs->trans("Cash").": ".price($cash);
|
print $langs->trans("Cash").": ".price($cash);
|
||||||
if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $cash != $cashcontrol->cash) {
|
if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $cash != $cashcontrol->cash) {
|
||||||
print ' <> <span class="amountremaintopay">'.$langs->trans("Declared").': '.price($cashcontrol->cash).'</span>';
|
print ' <> <span class="amountremaintopay">'.$langs->trans("Declared").': '.price($cashcontrol->cash).'</span>';
|
||||||
|
|||||||
@ -128,7 +128,7 @@ if ($object->id) {
|
|||||||
$modulepart = 'deplacement';
|
$modulepart = 'deplacement';
|
||||||
$permission = $user->rights->deplacement->creer;
|
$permission = $user->rights->deplacement->creer;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5512,12 +5512,6 @@ if ($action == 'create') {
|
|||||||
print showOnlinePaymentUrl('invoice', $object->ref).'<br>';
|
print showOnlinePaymentUrl('invoice', $object->ref).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show direct download link
|
|
||||||
if ($object->statut != Facture::STATUS_DRAFT && !empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) {
|
|
||||||
print '<br><!-- Link to download main doc -->'."\n";
|
|
||||||
print showDirectDownloadLink($object).'<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
|
|||||||
@ -4891,6 +4891,164 @@ class Facture extends CommonInvoice
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send reminders by emails for ivoices that are due
|
||||||
|
* CAN BE A CRON TASK
|
||||||
|
*
|
||||||
|
* @param int $nbdays Delay after due date (or before if delay is negative)
|
||||||
|
* @param string $paymentmode '' or 'all' by default (no filter), or 'LIQ', 'CHQ', CB', ...
|
||||||
|
* @param int|string $template Name (or id) of email template (Must be a template of type 'facture_send')
|
||||||
|
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||||
|
*/
|
||||||
|
public function sendEmailsReminderOnDueDate($nbdays = 0, $paymentmode = 'all', $template = '')
|
||||||
|
{
|
||||||
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
$this->output = '';
|
||||||
|
$this->error = '';
|
||||||
|
$nbMailSend = 0;
|
||||||
|
$errorsMsg = array();
|
||||||
|
|
||||||
|
if (empty($conf->facture->enabled)) { // Should not happen. If module disabled, cron job should not be visible.
|
||||||
|
$langs->load("bills");
|
||||||
|
$this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/*if (empty($conf->global->FACTURE_REMINDER_EMAIL)) {
|
||||||
|
$langs->load("bills");
|
||||||
|
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Facture"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
|
$formmail = new FormMail($this->db);
|
||||||
|
|
||||||
|
$now = dol_now();
|
||||||
|
$tmpinvoice = new Facture($this->db);
|
||||||
|
|
||||||
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
//Select all action comm reminder
|
||||||
|
$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."facture as f";
|
||||||
|
if (!empty($paymentmode) && $paymentmode != 'all') {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
|
||||||
|
}
|
||||||
|
$sql .= " WHERE f.paye = 0";
|
||||||
|
$sql .= " AND f.date_lim_reglement = '".$this->db->idate(dol_get_first_hour(dol_time_plus_duree(dol_now(), -1 * $nbdays, 'd'), 'gmt'), 'gmt')."'";
|
||||||
|
$sql .= " AND f.entity IN (".getEntity('facture').")";
|
||||||
|
if (!empty($paymentmode) && $paymentmode != 'all') {
|
||||||
|
$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
|
||||||
|
}
|
||||||
|
// TODO Add filter to check there is no payment started
|
||||||
|
$sql .= $this->db->order("date_lim_reglement", "ASC");
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
if (!$error) {
|
||||||
|
// Load event
|
||||||
|
$res = $tmpinvoice->fetch($obj->id);
|
||||||
|
if ($res > 0) {
|
||||||
|
$tmpinvoice->fetch_thirdparty();
|
||||||
|
|
||||||
|
$outputlangs = new Translate('', $conf);
|
||||||
|
if ($tmpinvoice->thirdparty->default_lang) {
|
||||||
|
$outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang);
|
||||||
|
} else {
|
||||||
|
$outputlangs = $langs;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select email template
|
||||||
|
$arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template));
|
||||||
|
if (is_numeric($arraymessage) && $arraymessage <= 0) {
|
||||||
|
$langs->load("bills");
|
||||||
|
$this->output = $langs->trans('FailedToFindEmailTemplate', $template);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// PREPARE EMAIL
|
||||||
|
$errormesg = '';
|
||||||
|
|
||||||
|
// Make substitution in email content
|
||||||
|
$substitutionarray = getCommonSubstitutionArray($langs, 0, '', $this);
|
||||||
|
|
||||||
|
complete_substitutions_array($substitutionarray, $langs, $this);
|
||||||
|
|
||||||
|
// Content
|
||||||
|
$sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray);
|
||||||
|
|
||||||
|
//Topic
|
||||||
|
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->trans('EventReminder'));
|
||||||
|
|
||||||
|
// Recipient
|
||||||
|
$res = $tmpinvoice->fetch_thirdparty();
|
||||||
|
$recipient = $tmpinvoice->thirdparty;
|
||||||
|
if ($res > 0) {
|
||||||
|
if (!empty($recipient->email)) {
|
||||||
|
$to = $recipient->email;
|
||||||
|
} else {
|
||||||
|
$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->fk_soc.". No email defined for user.";
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->fk_soc;
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sender
|
||||||
|
$from = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||||
|
if (empty($from)) {
|
||||||
|
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
// Errors Recipient
|
||||||
|
$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||||
|
|
||||||
|
$trackid = 'inv'.$tmpinvoice->id;
|
||||||
|
// Mail Creation
|
||||||
|
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', $trackid, '', '', '');
|
||||||
|
|
||||||
|
// Sending Mail
|
||||||
|
if ($cMailFile->sendfile()) {
|
||||||
|
$nbMailSend++;
|
||||||
|
} else {
|
||||||
|
$errormesg = $cMailFile->error.' : '.$to;
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($errormesg) {
|
||||||
|
$errorsMsg[] = $errormesg;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id;
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$this->output = 'Nb of emails sent : '.$nbMailSend;
|
||||||
|
$this->db->commit();
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
$this->db->commit(); // We commit also on error, to have the error message recorded.
|
||||||
|
$this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error;
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -182,7 +182,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$permission = $user->rights->facture->creer;
|
$permission = $user->rights->facture->creer;
|
||||||
$permtoedit = $user->rights->facture->creer;
|
$permtoedit = $user->rights->facture->creer;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -944,10 +944,10 @@ if ($resql) {
|
|||||||
$param .= $hookmanager->resPrint;
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
'validate'=>$langs->trans("Validate"),
|
'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
|
||||||
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
|
||||||
'builddoc'=>$langs->trans("PDFMerge"),
|
'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
'presend'=>$langs->trans("SendByMail"),
|
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
//'makepayment'=>$langs->trans("InvoicePaymentsLimits"), TODO Blank page when using this
|
//'makepayment'=>$langs->trans("InvoicePaymentsLimits"), TODO Blank page when using this
|
||||||
);
|
);
|
||||||
if ($conf->prelevement->enabled && !empty($user->rights->prelevement->bons->creer)) {
|
if ($conf->prelevement->enabled && !empty($user->rights->prelevement->bons->creer)) {
|
||||||
@ -956,9 +956,9 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
if ($user->rights->facture->supprimer) {
|
if ($user->rights->facture->supprimer) {
|
||||||
if (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY)) {
|
if (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY)) {
|
||||||
$arrayofmassactions['predeletedraft'] = $langs->trans("Deletedraft");
|
$arrayofmassactions['predeletedraft'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Deletedraft");
|
||||||
} elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { // mass deletion never possible on invoices on such situation
|
} elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { // mass deletion never possible on invoices on such situation
|
||||||
$arrayofmassactions['predelete'] = $langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (in_array($massaction, array('presend', 'predelete'))) {
|
if (in_array($massaction, array('presend', 'predelete'))) {
|
||||||
@ -1284,10 +1284,6 @@ if ($resql) {
|
|||||||
print '<td class="liste_titre right">';
|
print '<td class="liste_titre right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['f.date_closing']['checked'])) {
|
|
||||||
print '<td class="liste_titre">';
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
if (!empty($arrayfields['total_pa']['checked'])) {
|
if (!empty($arrayfields['total_pa']['checked'])) {
|
||||||
print '<td class="liste_titre right">';
|
print '<td class="liste_titre right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1322,6 +1318,11 @@ if ($resql) {
|
|||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Date closing
|
||||||
|
if (!empty($arrayfields['f.date_closing']['checked'])) {
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
if (!empty($arrayfields['f.note_public']['checked'])) {
|
if (!empty($arrayfields['f.note_public']['checked'])) {
|
||||||
// Note public
|
// Note public
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
@ -1335,7 +1336,7 @@ if ($resql) {
|
|||||||
// Status
|
// Status
|
||||||
if (!empty($arrayfields['f.fk_statut']['checked'])) {
|
if (!empty($arrayfields['f.fk_statut']['checked'])) {
|
||||||
print '<td class="liste_titre maxwidthonsmartphone right">';
|
print '<td class="liste_titre maxwidthonsmartphone right">';
|
||||||
$liststatus = array('0'=>$langs->trans("BillShortStatusDraft"), '1'=>$langs->trans("BillShortStatusNotPaid"), '2'=>$langs->trans("BillShortStatusPaid"), '1,2'=>$langs->trans("BillShortStatusNotPaid").'+'.$langs->trans("BillShortStatusPaid"), '3'=>$langs->trans("BillShortStatusCanceled"));
|
$liststatus = array('0'=>$langs->trans("BillShortStatusDraft"), '1'=>$langs->trans("BillShortStatusNotPaid"), '0,1'=>$langs->trans("BillShortStatusDraft").'+'.$langs->trans("BillShortStatusNotPaid"), '2'=>$langs->trans("BillShortStatusPaid"), '1,2'=>$langs->trans("BillShortStatusNotPaid").'+'.$langs->trans("BillShortStatusPaid"), '3'=>$langs->trans("BillShortStatusCanceled"));
|
||||||
print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -258,7 +258,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
|||||||
|
|
||||||
|
|
||||||
// Last modified supplier invoices
|
// Last modified supplier invoices
|
||||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
$facstatic = new FactureFournisseur($db);
|
$facstatic = new FactureFournisseur($db);
|
||||||
|
|
||||||
|
|||||||
@ -1597,7 +1597,7 @@ class BonPrelevement extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT soc.rowid as socid, soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
|
$sql = "SELECT soc.rowid as socid, soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
|
||||||
$sql .= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
|
$sql .= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
|
||||||
$sql .= " f.ref as fac, pf.fk_facture_fourn as idfac,";
|
$sql .= " f.ref as fac, pf.fk_facture_fourn as idfac, f.ref_supplier as fac_ref_supplier,";
|
||||||
$sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum";
|
$sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum";
|
||||||
$sql .= " FROM";
|
$sql .= " FROM";
|
||||||
$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
|
$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
|
||||||
@ -1633,7 +1633,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$cachearraytotestduplicate[$obj->idfac] = $obj->rowid;
|
$cachearraytotestduplicate[$obj->idfac] = $obj->rowid;
|
||||||
|
|
||||||
$daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec);
|
$daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec);
|
||||||
$fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type);
|
$fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac_ref_supplier, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type);
|
||||||
$this->total = $this->total + $obj->somme;
|
$this->total = $this->total + $obj->somme;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -1897,7 +1897,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$XML_DEBITOR .= ' <DrctDbtTxInf>'.$CrLf;
|
$XML_DEBITOR .= ' <DrctDbtTxInf>'.$CrLf;
|
||||||
$XML_DEBITOR .= ' <PmtId>'.$CrLf;
|
$XML_DEBITOR .= ' <PmtId>'.$CrLf;
|
||||||
// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
|
// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
|
||||||
$XML_DEBITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
$XML_DEBITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-'.dol_trunc($row_idfac.'-'.$row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||||
$XML_DEBITOR .= ' </PmtId>'.$CrLf;
|
$XML_DEBITOR .= ' </PmtId>'.$CrLf;
|
||||||
$XML_DEBITOR .= ' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
$XML_DEBITOR .= ' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
||||||
$XML_DEBITOR .= ' <DrctDbtTx>'.$CrLf;
|
$XML_DEBITOR .= ' <DrctDbtTx>'.$CrLf;
|
||||||
@ -1943,7 +1943,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$XML_CREDITOR .= ' <CdtTrfTxInf>'.$CrLf;
|
$XML_CREDITOR .= ' <CdtTrfTxInf>'.$CrLf;
|
||||||
$XML_CREDITOR .= ' <PmtId>'.$CrLf;
|
$XML_CREDITOR .= ' <PmtId>'.$CrLf;
|
||||||
// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
|
// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
|
||||||
$XML_CREDITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
$XML_CREDITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-'.dol_trunc($row_idfac.'-'.$row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||||
$XML_CREDITOR .= ' </PmtId>'.$CrLf;
|
$XML_CREDITOR .= ' </PmtId>'.$CrLf;
|
||||||
$XML_CREDITOR .= ' <Amt>'.$CrLf;
|
$XML_CREDITOR .= ' <Amt>'.$CrLf;
|
||||||
$XML_CREDITOR .= ' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
$XML_CREDITOR .= ' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
||||||
|
|||||||
@ -165,9 +165,9 @@ if ($object->id) {
|
|||||||
|
|
||||||
$modulepart = 'tax';
|
$modulepart = 'tax';
|
||||||
$permission = $user->rights->tax->charges->creer;
|
$permission = $user->rights->tax->charges->creer;
|
||||||
$permtoedit = $user->rights->fournisseur->facture->creer;
|
$permtoedit = $user->rights->tax->charges->creer;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -588,10 +588,10 @@ if (count($amount)) {
|
|||||||
if (!empty($conf->supplier_proposal->enabled) && $key > 0) {
|
if (!empty($conf->supplier_proposal->enabled) && $key > 0) {
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a> ';
|
print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a> ';
|
||||||
}
|
}
|
||||||
if (!empty($conf->fournisseur->enabled) && $key > 0) {
|
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $key > 0) {
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a> ';
|
print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a> ';
|
||||||
}
|
}
|
||||||
if (!empty($conf->fournisseur->enabled) && $key > 0) {
|
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $key > 0) {
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a> ';
|
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a> ';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -357,6 +357,7 @@ if ($id) {
|
|||||||
// Form to enter VAT
|
// Form to enter VAT
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New"));
|
print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New"));
|
||||||
|
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
print /** @lang JavaScript */'
|
print /** @lang JavaScript */'
|
||||||
@ -393,10 +394,15 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
|
print '<tr><td class="titlefieldcreate fieldrequired">';
|
||||||
|
//print $langs->trans("Type");
|
||||||
|
print '</td><td>';
|
||||||
|
|
||||||
print '<div id="selectmethod">';
|
print '<div id="selectmethod">';
|
||||||
print '<div class="hideonsmartphone float">';
|
|
||||||
print $langs->trans("Type").': ';
|
|
||||||
print '</div>';
|
|
||||||
print '<label for="radiopayment">';
|
print '<label for="radiopayment">';
|
||||||
print '<input type="radio" id="radiopayment" data-label="'.$langs->trans('VATPayment').'" class="flat" name="refund" value="0"'.($refund ? '' : ' checked="checked"').'>';
|
print '<input type="radio" id="radiopayment" data-label="'.$langs->trans('VATPayment').'" class="flat" name="refund" value="0"'.($refund ? '' : ' checked="checked"').'>';
|
||||||
print ' ';
|
print ' ';
|
||||||
@ -409,20 +415,9 @@ if ($action == 'create') {
|
|||||||
print $langs->trans("Refund");
|
print $langs->trans("Refund");
|
||||||
print '</label>';
|
print '</label>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print "<br>\n";
|
|
||||||
|
|
||||||
print dol_get_fiche_head();
|
print '</td>';
|
||||||
|
//print "<br>\n";
|
||||||
print '<table class="border centpercent">';
|
|
||||||
|
|
||||||
print '<tr class="hide_if_no_auto_create_payment">';
|
|
||||||
print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
|
||||||
print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).'</td><td>';
|
|
||||||
print $form->selectDate((GETPOST("datevmonth", 'int') ? $datev : -1), "datev", '', '', '', 'add', 1, 1);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
if ($refund == 1) {
|
if ($refund == 1) {
|
||||||
@ -430,10 +425,25 @@ if ($action == 'create') {
|
|||||||
} else {
|
} else {
|
||||||
$label = $langs->trans("VATPayment");
|
$label = $langs->trans("VATPayment");
|
||||||
}
|
}
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="minwidth300" name="label" id="label" value="'.($_POST["label"] ?GETPOST("label", '', 2) : $label).'"></td></tr>';
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input class="minwidth300" name="label" id="label" value="'.($_POST["label"] ?GETPOST("label", '', 2) : $label).'" autofocus></td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).'</td><td>';
|
||||||
|
print $form->selectDate((GETPOST("datevmonth", 'int') ? $datev : -1), "datev", '', '', '', 'add', 1, 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.GETPOST("amount", "alpha").'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" class="right width75" value="'.GETPOST("amount", "alpha").'"></td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td colspan="2"><hr></td></tr>';
|
||||||
|
|
||||||
|
// Auto create payment
|
||||||
|
print '<tr><td>'.$langs->trans('AutomaticCreationPayment').'</td>';
|
||||||
|
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_payment) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n";
|
||||||
|
|
||||||
|
print '<tr class="hide_if_no_auto_create_payment">';
|
||||||
|
print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
||||||
|
print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Type payment
|
// Type payment
|
||||||
print '<tr><td class="fieldrequired" id="label_type_payment">'.$langs->trans("PaymentMode").'</td><td>';
|
print '<tr><td class="fieldrequired" id="label_type_payment">'.$langs->trans("PaymentMode").'</td><td>';
|
||||||
@ -448,10 +458,6 @@ if ($action == 'create') {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto create payment
|
|
||||||
print '<tr><td>'.$langs->trans('AutomaticCreationPayment').'</td>';
|
|
||||||
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_payment) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n";
|
|
||||||
|
|
||||||
// Number
|
// Number
|
||||||
print '<tr class="hide_if_no_auto_create_payment"><td>'.$langs->trans('Numero');
|
print '<tr class="hide_if_no_auto_create_payment"><td>'.$langs->trans('Numero');
|
||||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||||
@ -473,9 +479,11 @@ if ($action == 'create') {
|
|||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<span class="hide_if_no_auto_create_payment">';
|
print '<div class="hide_if_no_auto_create_payment paddingbottom">';
|
||||||
print '<input type="checkbox" checked value="1" name="closepaidtva"> <span class="">'.$langs->trans("ClosePaidVATAutomatically").'</span>';
|
print '<input type="checkbox" checked value="1" name="closepaidtva"> <span class="">'.$langs->trans("ClosePaidVATAutomatically").'</span>';
|
||||||
print '</span><br>';
|
print '<br>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
|||||||
@ -151,9 +151,9 @@ if ($object->id) {
|
|||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
$permission = $user->rights->tax->charges->creer;
|
$permission = $user->rights->tax->charges->creer;
|
||||||
$permtoedit = $user->rights->fournisseur->facture->creer;
|
$permtoedit = $user->rights->tax->charges->creer;
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,10 +167,10 @@ if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) {
|
|||||||
|
|
||||||
if ($object->thirdparty->fournisseur) {
|
if ($object->thirdparty->fournisseur) {
|
||||||
$thirdTypeArray['supplier'] = $langs->trans("supplier");
|
$thirdTypeArray['supplier'] = $langs->trans("supplier");
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
|
||||||
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
|
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
|
||||||
}
|
}
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
|
||||||
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
|
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,6 +88,8 @@ if ($id > 0) {
|
|||||||
$upload_dir = $conf->societe->multidir_output[$object->entity].'/contact/'.dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->societe->multidir_output[$object->entity].'/contact/'.dol_sanitizeFileName($object->ref);
|
||||||
$modulepart = 'contact';
|
$modulepart = 'contact';
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$hookmanager->initHooks(array('contactdocument'));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -653,15 +653,15 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
// 'presend'=>$langs->trans("SendByMail"),
|
// 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
// 'builddoc'=>$langs->trans("PDFMerge"),
|
// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||||
if ($user->rights->societe->supprimer) {
|
if ($user->rights->societe->supprimer) {
|
||||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if ($user->rights->societe->creer) {
|
if ($user->rights->societe->creer) {
|
||||||
$arrayofmassactions['preaffecttag'] = '<span class="fa fa-tag paddingrightonly"></span>'.$langs->trans("AffectTag");
|
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||||
}
|
}
|
||||||
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
|
|||||||
@ -48,6 +48,8 @@ if ($id > 0) {
|
|||||||
|
|
||||||
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$hookmanager->initHooks(array('contactcard'));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -2124,12 +2124,6 @@ if ($action == 'create') {
|
|||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat'));
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
// Show direct download link
|
|
||||||
if ($object->statut != Contrat::STATUS_DRAFT && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) {
|
|
||||||
print '<br><!-- Link to download main doc -->'."\n";
|
|
||||||
print showDirectDownloadLink($object).'<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
$MAXEVENT = 10;
|
$MAXEVENT = 10;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user