Merge branch 'updevelop' into develop
This commit is contained in:
commit
8e7b1c361f
@ -28,12 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("admin");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("salaries");
|
||||
$langs->loadLangs(array("compta","bills","admin","accountancy","salaries"));
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
@ -880,7 +880,7 @@ if ($id)
|
||||
$valuetoshow=price($valuetoshow);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle_facture') {
|
||||
$langs->load("bills");
|
||||
$langs->loadLangs(array("bills"));
|
||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
$valuetoshow=nl2br($valuetoshow);
|
||||
@ -890,7 +890,7 @@ if ($id)
|
||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||
$langs->load("propal");
|
||||
$langs->loadLangs(array("propal"));
|
||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
@ -915,17 +915,17 @@ if ($id)
|
||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
|
||||
$langs->load('agenda');
|
||||
$langs->loadLangs(array("agenda"));
|
||||
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
|
||||
$langs->load("bills");
|
||||
$langs->loadLangs(array("bills"));
|
||||
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
|
||||
$langs->load("bills");
|
||||
$langs->loadLangs(array("bills"));
|
||||
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
@ -934,12 +934,12 @@ if ($id)
|
||||
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
|
||||
$langs->load("orders");
|
||||
$langs->loadLangs(array("orders"));
|
||||
$key=$langs->trans($obj->code);
|
||||
$valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]};
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
||||
$langs->load("sendings");
|
||||
$langs->loadLangs(array("sendings"));
|
||||
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
@ -950,7 +950,7 @@ if ($id)
|
||||
}
|
||||
else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
|
||||
{
|
||||
$langs->load('trips');
|
||||
$langs->loadLangs(array("trips"));
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
@ -961,11 +961,11 @@ if ($id)
|
||||
$valuetoshow = $langs->getCurrencySymbol($obj->code,1);
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
$langs->load("products");
|
||||
$langs->loadLangs(array("products"));
|
||||
$valuetoshow=$langs->trans($obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
$langs->load("products");
|
||||
$langs->loadLangs(array("products"));
|
||||
$valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
|
||||
|
||||
@ -31,9 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("bills","accountancy"));
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
@ -29,8 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
$langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("bills","accountancy"));
|
||||
|
||||
$mesg = '';
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
@ -178,7 +178,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
}
|
||||
if (! is_numeric(GETPOST('position','alpha')))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$langs->loadLangs(array("errors"));
|
||||
$ok=0;
|
||||
setEventMessages($langs->transnoentities('ErrorFieldMustBeANumeric', $langs->transnoentities("Position")), null, 'errors');
|
||||
}
|
||||
@ -735,7 +735,7 @@ if ($id)
|
||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||
$langs->load("propal");
|
||||
$langs->loadLangs(array("propal"));
|
||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
|
||||
@ -34,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("admin");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("salaries");
|
||||
$langs->load("loan");
|
||||
$langs->loadLangs(array("compta","bills","admin","accountancy","salaries","loan"));
|
||||
|
||||
// Security check
|
||||
if (empty($user->rights->accounting->chartofaccount))
|
||||
|
||||
@ -28,15 +28,11 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("admin");
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("compta","bills","admin","accountancy"));
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount))
|
||||
|
||||
@ -39,8 +39,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="f.rowid"; // Set here default search field
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("compta");
|
||||
$langs->loadLangs(array("admin","compta"));
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
|
||||
@ -26,8 +26,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("compta");
|
||||
$langs->loadLangs(array("admin","compta"));
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
|
||||
@ -26,8 +26,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("compta");
|
||||
$langs->loadLangs(array("admin","compta"));
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
|
||||
@ -24,16 +24,12 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("compta","bills","accountancy"));
|
||||
|
||||
// Security check
|
||||
if (! $user->admin)
|
||||
@ -141,7 +137,6 @@ if ($result) {
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -32,10 +32,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("admin");
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("compta","bills","admin","accountancy"));
|
||||
|
||||
// Security access
|
||||
if (empty($user->rights->accounting->chartofaccount))
|
||||
|
||||
@ -30,9 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("compta");
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("admin","compta","accountancy"));
|
||||
|
||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
@ -629,7 +627,7 @@ if ($id)
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
$key=$langs->trans("AccountingJournalType".strtoupper($obj->nature));
|
||||
$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($obj->nature)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
@ -35,12 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("companies");
|
||||
$langs->load("compta");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("products");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("companies","compta","accountancy","products"));
|
||||
|
||||
// Security check
|
||||
if (empty($conf->accounting->enabled)) {
|
||||
@ -360,7 +355,6 @@ if ($result)
|
||||
|
||||
$product_static = new Product($db);
|
||||
|
||||
$var = true;
|
||||
$i=0;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
|
||||
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
$page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
|
||||
@ -26,16 +26,11 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("main");
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("accountancy");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","other"));
|
||||
|
||||
// Filter
|
||||
$year = GETPOST("year",'int');
|
||||
@ -75,8 +70,6 @@ if ($result) {
|
||||
|
||||
$y = $year_current;
|
||||
|
||||
$var = true;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width=150>' . $langs->trans("Label") . '</td><td align="center">' . $langs->trans("JanuaryMin") . '</td><td align="center">' . $langs->trans("FebruaryMin") . '</td><td align="center">' . $langs->trans("MarchMin") . '</td><td align="center">' . $langs->trans("AprilMin") . '</td><td align="center">' . $langs->trans("MayMin") . '</td><td align="center">' . $langs->trans("JuneMin") . '</td><td align="center">' . $langs->trans("JulyMin") . '</td><td align="center">' . $langs->trans("AugustMin") . '</td><td align="center">' . $langs->trans("SeptemberMin") . '</td><td align="center">' . $langs->trans("OctoberMin") . '</td><td align="center">' . $langs->trans("NovemberMin") . '</td><td align="center">' . $langs->trans("DecemberMin") . '</td><td align="center"><b>Total</b></td></tr>';
|
||||
|
||||
@ -108,7 +101,7 @@ if ($resql) {
|
||||
|
||||
$row = $db->fetch_row($resql);
|
||||
|
||||
print '<tr><td width="14%">' . length_accountg($row[0]) . '</td>';
|
||||
print '<tr class="oddeven"><td width="14%">' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="right" width="6.5%">' . price($row[1]) . '</td>';
|
||||
print '<td align="right" width="6.5%">' . price($row[2]) . '</td>';
|
||||
print '<td align="right" width="6.5%">' . price($row[3]) . '</td>';
|
||||
|
||||
@ -32,8 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||
@ -431,7 +430,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
$listofformat=AccountancyExport::getType();
|
||||
$button = '<a class="butActionNew" name="button_export_file" href="'.$_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'').'">';
|
||||
$button = '<a class="butAction" name="button_export_file" href="'.$_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'').'">';
|
||||
if (count($filter)) $button.= $langs->trans("ExportFilteredList");
|
||||
else $button.= $langs->trans("ExportList");
|
||||
//$button.=' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')';
|
||||
|
||||
@ -33,8 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
$page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
|
||||
@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
|
||||
$langs->loadLangs(array("compta"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
@ -141,7 +143,6 @@ if ($object->check_codeclient() != 0)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$langs->load('compta');
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("CustomerAccountancyCode", 'customeraccountancycode', $object->code_compta, $object, $user->rights->societe->creer);
|
||||
|
||||
@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
|
||||
$langs->loadLangs(array("compta"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
@ -157,7 +159,6 @@ if ($object->check_codefournisseur() != 0)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$langs->load('compta');
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer);
|
||||
|
||||
@ -566,7 +566,7 @@ class AccountingAccount extends CommonObject
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load('users');
|
||||
$langs->loadLangs(array("users"));
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
|
||||
@ -256,7 +256,7 @@ class AccountingJournal extends CommonObject
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
|
||||
@ -170,7 +170,7 @@ class BookKeeping extends CommonObject
|
||||
// Check parameters
|
||||
if (empty($this->numero_compte) || $this->numero_compte == '-1' || $this->numero_compte == 'NotDefined')
|
||||
{
|
||||
$langs->load("errors");
|
||||
$langs->loadLangs(array("errors"));
|
||||
if (in_array($this->doc_type, array('bank', 'expense_report')))
|
||||
{
|
||||
$this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForBankLine', $this->fk_docdet, $this->doc_type);
|
||||
|
||||
@ -24,13 +24,10 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("bills","accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
@ -35,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
$langs->load("compta");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("productbatch");
|
||||
$langs->loadLangs(array("bills","compta","accountancy","productbatch"));
|
||||
|
||||
$account_parent = GETPOST('account_parent');
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
@ -116,10 +110,10 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
@ -173,20 +167,24 @@ print '<script type="text/javascript">
|
||||
/*
|
||||
* Customer Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.datef, f.ref_client,";
|
||||
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||
$sql .= " fd.situation_percent, co.label as country, s.tva_intra";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql .= " WHERE fd.fk_code_ventilation > 0 ";
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
$sql = "SELECT f.rowid as facid, f.facnumber as ref, f.type, f.datef, f.ref_client,";
|
||||
$sql.= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||
$sql.= " fd.situation_percent,";
|
||||
$sql.= " co.label as country, s.tva_intra";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " WHERE fd.fk_code_ventilation > 0";
|
||||
$sql.= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
$sql.= " AND f.fk_statut > 0";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
@ -291,11 +289,11 @@ if ($result) {
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
|
||||
$formother->select_year($search_year,'search_year',1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
@ -303,9 +301,9 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
@ -320,9 +318,9 @@ if ($result) {
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
$clickpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($clickpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
@ -333,16 +331,18 @@ if ($result) {
|
||||
while ( $objp = $db->fetch_object($result) ) {
|
||||
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
|
||||
|
||||
$facture_static->ref = $objp->facnumber;
|
||||
$facture_static->ref = $objp->ref;
|
||||
$facture_static->id = $objp->facid;
|
||||
|
||||
$facture_static->type = $objp->ftype;
|
||||
|
||||
$product_static->ref = $objp->product_ref;
|
||||
$product_static->id = $objp->product_id;
|
||||
$product_static->type = $objp->product_type;
|
||||
$product_static->type = $objp->type;
|
||||
$product_static->label = $objp->product_label;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Line id
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
// Ref Invoice
|
||||
@ -357,7 +357,7 @@ if ($result) {
|
||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description);
|
||||
@ -365,16 +365,17 @@ if ($result) {
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print $codecompta . ' <a href="./card.php?id=' . $objp->rowid . '&backtopage='.urlencode($_SERVER["PHP_SELF"].($param?'?'.$param:'')).'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
|
||||
print "</tr>";
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
@ -36,13 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("productbatch");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","other","productbatch"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$massaction=GETPOST('massaction','alpha');
|
||||
@ -55,8 +49,8 @@ $mesCasesCochees = GETPOST('toselect', 'array');
|
||||
|
||||
// Search Getpost
|
||||
$search_lineid = GETPOST('search_lineid', 'int');
|
||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
$search_desc = GETPOST('search_desc', 'alpha');
|
||||
$search_amount = GETPOST('search_amount', 'alpha');
|
||||
@ -65,6 +59,8 @@ $search_vat = GETPOST('search_vat', 'alpha');
|
||||
$search_day=GETPOST("search_day","int");
|
||||
$search_month=GETPOST("search_month","int");
|
||||
$search_year=GETPOST("search_year","int");
|
||||
$search_country = GETPOST('search_country', 'alpha');
|
||||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
$btn_ventil = GETPOST('ventil', 'alpha');
|
||||
|
||||
@ -103,7 +99,7 @@ $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'acco
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
||||
@ -129,6 +125,8 @@ if (empty($reshook))
|
||||
$search_day = '';
|
||||
$search_month = '';
|
||||
$search_year = '';
|
||||
$search_country = '';
|
||||
$search_tvaintra = '';
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
@ -209,14 +207,17 @@ if (empty($chartaccountcode))
|
||||
}
|
||||
|
||||
// Customer Invoice lines
|
||||
$sql = "SELECT f.rowid as facid, f.facnumber, f.datef, f.type as ftype,";
|
||||
$sql = "SELECT f.rowid as facid, f.facnumber as ref, f.datef, f.type as ftype,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid";
|
||||
$sql.= " aa.rowid as aarowid,";
|
||||
$sql.= " co.label as country, s.tva_intra";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
|
||||
@ -229,25 +230,25 @@ if ($search_lineid) {
|
||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= natural_search("f.facnumber",$search_invoice);
|
||||
$sql .= natural_search("f.facnumber", $search_invoice);
|
||||
}
|
||||
if (strlen(trim($search_ref))) {
|
||||
$sql .= natural_search("p.ref",$search_ref);
|
||||
$sql .= natural_search("p.ref", $search_ref);
|
||||
}
|
||||
if (strlen(trim($search_label))) {
|
||||
$sql .= natural_search("p.label",$search_label);
|
||||
$sql .= natural_search("p.label", $search_label);
|
||||
}
|
||||
if (strlen(trim($search_desc))) {
|
||||
$sql .= natural_search("l.description",$search_desc);
|
||||
$sql .= natural_search("l.description", $search_desc);
|
||||
}
|
||||
if (strlen(trim($search_amount))) {
|
||||
$sql .= natural_search("l.total_ht",$search_amount,1);
|
||||
$sql .= natural_search("l.total_ht", $search_amount, 1);
|
||||
}
|
||||
if (strlen(trim($search_account))) {
|
||||
$sql .= natural_search("aa.account_number",$search_account);
|
||||
$sql .= natural_search("aa.account_number", $search_account);
|
||||
}
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
||||
$sql .= natural_search("l.tva_tx", $search_vat, 1);
|
||||
}
|
||||
if ($search_month > 0)
|
||||
{
|
||||
@ -262,6 +263,12 @@ else if ($search_year > 0)
|
||||
{
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||
}
|
||||
if (strlen(trim($search_country))) {
|
||||
$sql .= natural_search("co.label", $search_country);
|
||||
}
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= natural_search("s.tva_intra", $search_tvaintra);
|
||||
}
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
@ -306,6 +313,8 @@ if ($result) {
|
||||
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
|
||||
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
|
||||
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
|
||||
if ($search_country) $param .= "&search_country=" . urlencode($search_country);
|
||||
if ($search_tvaintra) $param .= "&search_tvaintra=" . urlencode($search_tvaintra);
|
||||
|
||||
$arrayofmassactions = array(
|
||||
'ventil'=>$langs->trans("Ventilate")
|
||||
@ -344,9 +353,9 @@ if ($result) {
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
$formother->select_year($search_year,'search_year',1, 20, 5);
|
||||
@ -356,6 +365,8 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50 right" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="center" class="liste_titre">';
|
||||
@ -373,6 +384,8 @@ if ($result) {
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"');
|
||||
$checkpicto='';
|
||||
@ -382,9 +395,7 @@ if ($result) {
|
||||
|
||||
$facture_static = new Facture($db);
|
||||
$product_static = new Product($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
@ -397,7 +408,7 @@ if ($result) {
|
||||
$product_static->type = $objp->type;
|
||||
$product_static->label = $objp->product_label;
|
||||
|
||||
$facture_static->ref = $objp->facnumber;
|
||||
$facture_static->ref = $objp->ref;
|
||||
$facture_static->id = $objp->facid;
|
||||
$facture_static->type = $objp->ftype;
|
||||
|
||||
@ -461,6 +472,10 @@ if ($result) {
|
||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
|
||||
print '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
// Current account
|
||||
print '<td align="center" style="' . $code_sell_p_notset . '">';
|
||||
print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("Unknown"));
|
||||
|
||||
@ -28,14 +28,10 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("trips");
|
||||
$langs->loadLangs(array("bills","accountancy","trips"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
@ -34,14 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("trips");
|
||||
$langs->load("productbatch");
|
||||
$langs->loadLangs(array("compta","bills","other","accountancy","trips","productbatch"));
|
||||
|
||||
$account_parent = GETPOST('account_parent','int');
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
@ -35,14 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("trips");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("productbatch");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","other","trips","productbatch"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$massaction=GETPOST('massaction','alpha');
|
||||
@ -345,7 +338,6 @@ if ($result) {
|
||||
$expensereport_static = new ExpenseReport($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
|
||||
@ -26,26 +26,12 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("dict");
|
||||
$langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("compta");
|
||||
$langs->load("banks");
|
||||
$langs->load("loans");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
@ -28,13 +28,10 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
$langs->loadLangs(array("bills","accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
|
||||
@ -26,22 +26,16 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("productbatch");
|
||||
$langs->loadLangs(array("compta","bills","other","accountancy","productbatch"));
|
||||
|
||||
$account_parent = GETPOST('account_parent');
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
@ -117,10 +111,11 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
@ -173,10 +168,13 @@ print '<script type="text/javascript">
|
||||
/*
|
||||
* Supplier Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid as facid, f.ref as facnumber, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
|
||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
|
||||
$sql.= " aa.label, aa.account_number, ";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
|
||||
@ -230,6 +228,11 @@ if (strlen(trim($search_tvaintra))) {
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
@ -242,7 +245,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::list');
|
||||
dol_syslog('accountancy/supplier/lines.php');
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
@ -273,7 +276,7 @@ if ($result) {
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
print $langs->trans("DescVentilDoneSupplier") . '<br>';
|
||||
|
||||
@ -283,11 +286,12 @@ if ($result) {
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
@ -300,10 +304,10 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -319,22 +323,22 @@ if ($result) {
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
$facturefournisseur_static = new FactureFournisseur($db);
|
||||
$product_static = new Product($db);
|
||||
$product_static = new ProductFournisseur($db);
|
||||
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label;
|
||||
|
||||
$facturefournisseur_static->ref = $objp->facnumber;
|
||||
$facturefournisseur_static->ref = $objp->ref;
|
||||
$facturefournisseur_static->id = $objp->facid;
|
||||
|
||||
$product_static->ref = $objp->product_ref;
|
||||
@ -344,24 +348,26 @@ if ($result) {
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Line id
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
print $objp->invoice_label;
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
// Ref Product
|
||||
// Ref product
|
||||
print '<td>';
|
||||
if ($product_static->id)
|
||||
print $product_static->getNomUrl(1);
|
||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
||||
print '</td>';
|
||||
|
||||
// Description
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
@ -370,18 +376,20 @@ if ($result) {
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print $codecompta . ' <a href="./card.php?id=' . $objp->rowid . '&backtopage='.urlencode($_SERVER["PHP_SELF"].($param?'?'.$param:'')) . '">';
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
|
||||
print "</tr>";
|
||||
print '</tr>';
|
||||
$i ++;
|
||||
}
|
||||
print "</table>";
|
||||
print '</table>';
|
||||
print "</div>";
|
||||
|
||||
if ($nbtotalofrecords > $limit) {
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
@ -36,13 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("productbatch");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","other","productbatch"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$massaction=GETPOST('massaction','alpha');
|
||||
@ -65,6 +59,8 @@ $search_vat = GETPOST('search_vat', 'alpha');
|
||||
$search_day=GETPOST("search_day","int");
|
||||
$search_month=GETPOST("search_month","int");
|
||||
$search_year=GETPOST("search_year","int");
|
||||
$search_country = GETPOST('search_country', 'alpha');
|
||||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
$btn_ventil = GETPOST('ventil', 'alpha');
|
||||
|
||||
@ -104,7 +100,7 @@ $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'acco
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
|
||||
@ -130,6 +126,8 @@ if (empty($reshook))
|
||||
$search_day = '';
|
||||
$search_month = '';
|
||||
$search_year = '';
|
||||
$search_country = '';
|
||||
$search_tvaintra = '';
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
@ -213,11 +211,14 @@ if (empty($chartaccountcode))
|
||||
$sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.type as ftype,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid";
|
||||
$sql.= " aa.rowid as aarowid,";
|
||||
$sql.= " co.label as country, s.tva_intra";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
|
||||
@ -228,25 +229,28 @@ if ($search_lineid) {
|
||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= natural_search("f.ref",$search_invoice);
|
||||
$sql .= natural_search("f.ref", $search_invoice);
|
||||
}
|
||||
if (strlen(trim($search_ref))) {
|
||||
$sql .= natural_search("p.ref",$search_ref);
|
||||
$sql .= natural_search("p.ref", $search_ref);
|
||||
}
|
||||
if (strlen(trim($search_label))) {
|
||||
$sql .= natural_search("p.label",$search_label);
|
||||
$sql .= natural_search("p.label", $search_label);
|
||||
}
|
||||
if (strlen(trim($search_desc))) {
|
||||
$sql .= natural_search("l.description",$search_desc);
|
||||
$sql .= natural_search("l.description", $search_desc);
|
||||
}
|
||||
if (strlen(trim($search_amount))) {
|
||||
$sql .= natural_search("l.total_ht",$search_amount,1);
|
||||
$sql .= natural_search("l.total_ht", $search_amount, 1);
|
||||
}
|
||||
if (strlen(trim($search_account))) {
|
||||
$sql .= natural_search("aa.account_number",$search_account);
|
||||
$sql .= natural_search("aa.account_number", $search_account);
|
||||
}
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
||||
$sql .= natural_search("l.tva_tx", price2num($search_vat), 1);
|
||||
}
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= natural_search("s.tva_intra", $search_tvaintra);
|
||||
}
|
||||
if ($search_month > 0)
|
||||
{
|
||||
@ -261,6 +265,9 @@ else if ($search_year > 0)
|
||||
{
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||
}
|
||||
if (strlen(trim($search_country))) {
|
||||
$sql .= natural_search("co.label", $search_country);
|
||||
}
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . FactureFournisseur::TYPE_STANDARD . "," . FactureFournisseur::TYPE_REPLACEMENT . "," . FactureFournisseur::TYPE_CREDIT_NOTE . "," . FactureFournisseur::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
@ -287,6 +294,7 @@ $sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
dol_syslog('accountancy/supplier/list.php');
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
@ -305,6 +313,8 @@ if ($result) {
|
||||
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
|
||||
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
|
||||
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
|
||||
if ($search_country) $param .= "&search_country=" . urlencode($search_country);
|
||||
if ($search_tvaintra) $param .= "&search_tvaintra=" . urlencode($search_tvaintra);
|
||||
|
||||
$arrayofmassactions = array(
|
||||
'ventil'=>$langs->trans("Ventilate")
|
||||
@ -343,26 +353,28 @@ if ($result) {
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
$formother->select_year($search_year,'search_year',1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="center" class="liste_titre">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
@ -374,6 +386,8 @@ if ($result) {
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"');
|
||||
$checkpicto='';
|
||||
@ -383,10 +397,8 @@ if ($result) {
|
||||
|
||||
$facturefourn_static = new FactureFournisseur($db);
|
||||
$productfourn_static = new ProductFournisseur($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
// product_type: 0 = service ? 1 = product
|
||||
@ -448,9 +460,9 @@ if ($result) {
|
||||
if ($productfourn_static->id)
|
||||
print $productfourn_static->getNomUrl(1);
|
||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
||||
print '</td>';
|
||||
print '</td>';
|
||||
|
||||
// Description
|
||||
// Description
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
@ -468,6 +480,9 @@ if ($result) {
|
||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
|
||||
print '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
// Current account
|
||||
print '<td align="center" style="' . $code_buy_p_notset . '">';
|
||||
print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : $langs->trans("Unknown"));
|
||||
|
||||
@ -29,19 +29,18 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_cards.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printsheet/modules_labels.php';
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("errors");
|
||||
$langs->loadLangs(array("members","errors"));
|
||||
|
||||
// Choix de l'annee d'impression ou annee courante.
|
||||
$now = dol_now();
|
||||
$year=dol_print_date($now,'%Y');
|
||||
$month=dol_print_date($now,'%m');
|
||||
$day=dol_print_date($now,'%d');
|
||||
$foruserid=GETPOST('foruserid');
|
||||
$foruserlogin=GETPOST('foruserlogin');
|
||||
$mode=GETPOST('mode');
|
||||
$model=GETPOST("model"); // Doc template to use for business cards
|
||||
$modellabel=GETPOST("modellabel"); // Doc template to use for address sheet
|
||||
$foruserid=GETPOST('foruserid','alphanohtml');
|
||||
$foruserlogin=GETPOST('foruserlogin','alphanohtml');
|
||||
$mode=GETPOST('mode','aZ09');
|
||||
$model=GETPOST("model",'aZ09'); // Doc template to use for business cards
|
||||
$modellabel=GETPOST("modellabel",'aZ09'); // Doc template to use for address sheet
|
||||
$mesg='';
|
||||
|
||||
$adherentstatic=new Adherent($db);
|
||||
|
||||
@ -43,7 +43,7 @@ $toselect = GETPOST('toselect', 'array');
|
||||
$result=restrictedArea($user,'adherent');
|
||||
|
||||
$filter=GETPOST("filter",'alpha');
|
||||
$statut=GETPOST("statut",'alpha');
|
||||
$statut=GETPOST("statut",'intcomma');
|
||||
$search=GETPOST("search",'alpha');
|
||||
$search_ref=GETPOST("search_ref",'alpha');
|
||||
$search_lastname=GETPOST("search_lastname",'alpha');
|
||||
|
||||
@ -75,6 +75,12 @@ else
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_event = '';
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if (GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') ||GETPOST('button_search','alpha')) // To avoid the save when we click on search
|
||||
{
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == "save" && empty($cancel))
|
||||
@ -106,34 +112,6 @@ if ($action == "save" && empty($cancel))
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
$value=(GETPOST($code) ? GETPOST($code) : 1);
|
||||
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_(.*)/',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -52,10 +52,10 @@ $type = 'action';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
$value=(GETPOST($code) ? GETPOST($code) : 1);
|
||||
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
|
||||
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
@ -67,7 +67,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_(.*)/',$action,$reg))
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
|
||||
@ -47,10 +47,10 @@ $type = 'action';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
$value=(GETPOST($code) ? GETPOST($code) : 1);
|
||||
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
|
||||
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
@ -62,7 +62,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_(.*)/',$action,$reg))
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -212,9 +212,9 @@ print "<br>\n";
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
if (defaulturl) $param.='&defaulturl='.urlencode(defaulturl);
|
||||
if (defaultkey) $param.='&defaultkey='.urlencode(defaultkey);
|
||||
if (defaultvalue) $param.='&defaultvalue='.urlencode(defaultvalue);
|
||||
if ($defaulturl) $param.='&defaulturl='.urlencode($defaulturl);
|
||||
if ($defaultkey) $param.='&defaultkey='.urlencode($defaultkey);
|
||||
if ($defaultvalue) $param.='&defaultvalue='.urlencode($defaultvalue);
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||
|
||||
@ -33,7 +33,7 @@ if (! $user->admin) accessforbidden();
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
@ -47,7 +47,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_(.*)/',$action,$reg))
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
|
||||
@ -169,9 +169,10 @@ if ($conf->adherent->enabled) $elementList['member']=$langs->trans('Mai
|
||||
if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract');
|
||||
if ($conf->projet->enabled) $elementList['project']=$langs->trans('MailToProject');
|
||||
$elementList['user']=$langs->trans('MailToUser');
|
||||
$elementList['all'] =$langs->trans('VisibleEverywhere');
|
||||
$elementList['none']=$langs->trans('VisibleNowhere');
|
||||
|
||||
sort($elementList);
|
||||
// Add all and none after the sort
|
||||
$elementList['all'] ='-- '.$langs->trans("All").' -- ('.$langs->trans('VisibleEverywhere').')';
|
||||
$elementList['none']='-- '.$langs->trans("None").' -- ('.$langs->trans('VisibleNowhere').')';
|
||||
|
||||
$parameters=array('elementList'=>$elementList);
|
||||
$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
@ -726,10 +727,10 @@ if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
|
||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||
{
|
||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
|
||||
$tmpaction='edit';
|
||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook=$hookmanager->executeHooks('editEmailTemplateFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
@ -787,10 +788,23 @@ if ($resql)
|
||||
print '<td></td>';
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpaction = 'view';
|
||||
$keyforobj='type_template';
|
||||
if (! in_array($obj->$keyforobj, array_keys($elementList)))
|
||||
{
|
||||
$i++;
|
||||
continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled)
|
||||
}
|
||||
// TODO Test on 'enabled'
|
||||
|
||||
|
||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
|
||||
$tmpaction = 'view';
|
||||
$parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook=$hookmanager->executeHooks('viewEmailTemplateFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
@ -876,7 +890,6 @@ if ($resql)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
/*
|
||||
$fieldsforcontent = array('content');
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES))
|
||||
@ -904,8 +917,9 @@ if ($resql)
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$i++;
|
||||
|
||||
@ -48,10 +48,11 @@ $action = GETPOST('action', 'alpha');
|
||||
*/
|
||||
|
||||
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, GETPOST($code), 'chaine', 0, '', $conf->entity) > 0)
|
||||
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
|
||||
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
@ -62,7 +63,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_(.*)/',$action,$reg))
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, 0) > 0)
|
||||
|
||||
@ -51,41 +51,17 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
dol_add_file_process($upload_dir, 0, 0, 'userfile');
|
||||
}
|
||||
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
if ($action == 'updateform')
|
||||
{
|
||||
$code=$reg[1];
|
||||
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
|
||||
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$antivircommand = GETPOST('MAIN_ANTIVIRUS_COMMAND','none'); // Use GETPOST none because we must accept ". Example c:\Progra~1\ClamWin\bin\clamscan.exe
|
||||
$antivirparam = GETPOST('MAIN_ANTIVIRUS_PARAM','none'); // Use GETPOST none because we must accept ". Example --database="C:\Program Files (x86)\ClamWin\lib"
|
||||
$antivircommand = dol_string_nospecial($antivircommand, '', array("|", ";", "<", ">", "&")); // Sanitize command
|
||||
$antivirparam = dol_string_nospecial($antivirparam, '', array("|", ";", "<", ">", "&")); // Sanitize params
|
||||
|
||||
else if (preg_match('/del_(.*)/',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'updateform')
|
||||
{
|
||||
$res3=dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',GETPOST('MAIN_UPLOAD_DOC','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res4=dolibarr_set_const($db, "MAIN_UMASK", GETPOST('MAIN_UMASK','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim(GETPOST('MAIN_ANTIVIRUS_COMMAND','none')),'chaine',0,'',$conf->entity); // Use GETPOST none because we must accept "
|
||||
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim(GETPOST('MAIN_ANTIVIRUS_PARAM','none')),'chaine',0,'',$conf->entity); // Use GETPOST none because we must accept "
|
||||
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim($antivircommand),'chaine',0,'',$conf->entity);
|
||||
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim($antivirparam),'chaine',0,'',$conf->entity);
|
||||
if ($res3 && $res4 && $res5 && $res6) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
}
|
||||
|
||||
@ -95,10 +71,10 @@ else if ($action == 'updateform')
|
||||
else if ($action == 'delete')
|
||||
{
|
||||
$langs->load("other");
|
||||
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile','alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile','alpha')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile','alpha')), null, 'errors');
|
||||
Header('Location: '.$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -43,10 +43,10 @@ $action=GETPOST('action','alpha');
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
$value=(GETPOST($code) ? GETPOST($code) : 1);
|
||||
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
|
||||
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
@ -58,7 +58,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
else if (preg_match('/del_(.*)/',$action,$reg))
|
||||
else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
|
||||
@ -71,7 +71,7 @@ if ($action == 'updateMask') {
|
||||
if (!empty($notification_email)) {
|
||||
$res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_FROM', '000000', 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_FROM', '', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
@ -82,7 +82,7 @@ if ($action == 'updateMask') {
|
||||
if (!empty($notification_email_to)) {
|
||||
$res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_TO', $notification_email_to, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_TO', '000000', 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_EMAIL_TO', '', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
@ -184,16 +184,22 @@ if ($action == 'setvarother') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$param_show_module_logo = GETPOST('TICKETS_SHOW_MODULE_LOGO', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKETS_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
$param_show_module_logo = GETPOST('TICKETS_SHOW_MODULE_LOGO', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKETS_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$param_notification_also_main_addressemail = GETPOST('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
$param_notification_also_main_addressemail = GETPOST('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$param_limit_view = GETPOST('TICKETS_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
|
||||
@ -380,20 +386,23 @@ print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'h
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Show logo for module
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowModuleLogo") . '</td>';
|
||||
print '<td align="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKETS_SHOW_MODULE_LOGO');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TICKETS_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKETS_SHOW_MODULE_LOGO);
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
// Show logo for module
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowModuleLogo") . '</td>';
|
||||
print '<td align="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKETS_SHOW_MODULE_LOGO');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TICKETS_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKETS_SHOW_MODULE_LOGO);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Show logo for company
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowCompanyLogo") . '</td>';
|
||||
@ -446,19 +455,22 @@ print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Also send to main email address
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . '</td>';
|
||||
print '<td align="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS);
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . '</td>';
|
||||
print '<td align="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Limiter la vue des tickets à ceux assignés à l'utilisateur
|
||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsLimitViewAssignedOnly") . '</td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2006-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -36,7 +36,7 @@ $sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="date";
|
||||
if ($page < 0) { $page = 0; }
|
||||
if (empty($page) || $page == -1) { $page = 0; }
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ elseif ($action == 'setdoc')
|
||||
}
|
||||
$res = true;
|
||||
}
|
||||
elseif (preg_match('/set_(.*)/',$action,$reg))
|
||||
elseif (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
@ -100,7 +100,7 @@ elseif (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
elseif (preg_match('/del_(.*)/',$action,$reg))
|
||||
elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
|
||||
@ -83,7 +83,7 @@ elseif ($action == 'setdoc')
|
||||
}
|
||||
$res = true;
|
||||
}
|
||||
elseif (preg_match('/set_(.*)/',$action,$reg))
|
||||
elseif (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
@ -97,7 +97,7 @@ elseif (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
elseif (preg_match('/del_(.*)/',$action,$reg))
|
||||
elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
|
||||
@ -38,7 +38,7 @@ $action=GETPOST('action','aZ09');
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
@ -52,7 +52,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_(.*)/',$action,$reg))
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
|
||||
@ -7,11 +7,8 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
<<<<<<< HEAD
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
=======
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
|
||||
>>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git
|
||||
*
|
||||
* 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
|
||||
|
||||
@ -1588,7 +1588,7 @@ else
|
||||
|
||||
if ($action != 'editline' || GETPOST('rowid') != $objp->rowid)
|
||||
{
|
||||
print '<tr '.$bcnd[$var].' class="tdtop">';
|
||||
print '<tr class="tdtop oddeven">';
|
||||
// Label
|
||||
if ($objp->fk_product > 0)
|
||||
{
|
||||
@ -1684,7 +1684,7 @@ else
|
||||
$colspan = 7;
|
||||
}
|
||||
|
||||
print '<tr '.$bcnd[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
|
||||
// Date planned
|
||||
@ -1721,14 +1721,14 @@ else
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||
$line = new ContratLigne($db);
|
||||
$line->fetch_optionals($objp->rowid);
|
||||
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bcnd[$var], 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
}
|
||||
// Ligne en mode update
|
||||
else
|
||||
{
|
||||
// Ligne carac
|
||||
print "<tr ".$bcnd[$var].">";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
if ($objp->fk_product)
|
||||
{
|
||||
@ -1783,7 +1783,7 @@ else
|
||||
if($conf->global->PRODUCT_USE_UNITS) $colspan++;
|
||||
|
||||
// Ligne dates prevues
|
||||
print "<tr ".$bcnd[$var].">";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
print $langs->trans("DateStartPlanned").' ';
|
||||
$form->select_date($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update");
|
||||
@ -1795,7 +1795,7 @@ else
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||
$line = new ContratLigne($db);
|
||||
$line->fetch_optionals($objp->rowid);
|
||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1808,7 +1808,7 @@ else
|
||||
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
print '<tr '.$bcnd[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="tdhrthin" colspan="'.($conf->margin->enabled?7:6).'"><hr class="opacitymedium tdhrthin"></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
@ -1886,7 +1886,7 @@ else
|
||||
{
|
||||
print '<table class="notopnoleftnoright tableforservicepart2'.($cursorline < $nbofservices ?' boxtablenobottom':'').'" width="100%">';
|
||||
|
||||
print '<tr '.$bcnd[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline-1]->getLibStatut(4).'</td>';
|
||||
print '<td width="30" align="right">';
|
||||
if ($user->societe_id == 0)
|
||||
@ -1913,7 +1913,7 @@ else
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr '.$bcnd[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
// Si pas encore active
|
||||
@ -1969,7 +1969,7 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nohover">'.$langs->trans("DateServiceActivate").'</td><td class="nohover">';
|
||||
print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1);
|
||||
print '</td>';
|
||||
@ -1981,7 +1981,7 @@ else
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nohover">'.$langs->trans("Comment").'</td><td colspan="3" class="nohover" colspan="'.($conf->margin->enabled?4:3).'"><input size="80" type="text" name="comment" value="'.$_POST["comment"].'"></td>';
|
||||
print '<td class="nohover right">';
|
||||
print '<input type="submit" class="button" name="activate" value="'.$langs->trans("Activate").'"> ';
|
||||
@ -2026,7 +2026,7 @@ else
|
||||
$now=dol_now();
|
||||
if ($dateactend > $now) $dateactend=$now;
|
||||
|
||||
print '<tr '.$bc[false].'><td colspan="2" class="nohover">';
|
||||
print '<tr class="oddeven"><td colspan="2" class="nohover">';
|
||||
if ($objp->statut >= 4)
|
||||
{
|
||||
if ($objp->statut == 4)
|
||||
@ -2039,7 +2039,7 @@ else
|
||||
print '<td class="center nohover">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nohover">'.$langs->trans("Comment").'</td><td class="nohover"><input size="70" type="text" class="flat" name="comment" value="'.dol_escape_htmltag(GETPOST('comment', 'alpha')).'"></td>';
|
||||
print '<td class="nohover right">';
|
||||
print '<input type="submit" class="button" name="close" value="'.$langs->trans("Disable").'"> ';
|
||||
@ -2079,8 +2079,6 @@ else
|
||||
// Form to add new line
|
||||
if ($action != 'editline')
|
||||
{
|
||||
$var = true;
|
||||
|
||||
$forcetoshowtitlelines=1;
|
||||
|
||||
// Add free products/services
|
||||
@ -2201,8 +2199,7 @@ else
|
||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
$genallowed = $user->rights->contrat->lire;
|
||||
$delallowed = $user->rights->contrat->creer;
|
||||
|
||||
$var = true;
|
||||
|
||||
|
||||
print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
|
||||
|
||||
@ -204,6 +204,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk
|
||||
$sql.= " cd.date_ouverture_prevue,";
|
||||
$sql.= " cd.date_ouverture,";
|
||||
$sql.= " cd.date_fin_validite,";
|
||||
$sql.= " cd.date_cloture,";
|
||||
$sql.= " cd.qty,";
|
||||
$sql.= " cd.total_ht,";
|
||||
$sql.= " cd.total_tva,";
|
||||
@ -632,7 +633,7 @@ while ($i < min($num,$limit))
|
||||
if (! empty($arrayfields['cd.date_ouverture_prevue']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' ');
|
||||
print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue), 'dayhour'):' ');
|
||||
if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)) && $obj->statut == 0)
|
||||
print ' '.img_picto($langs->trans("Late"),"warning");
|
||||
else print ' ';
|
||||
@ -641,13 +642,13 @@ while ($i < min($num,$limit))
|
||||
}
|
||||
if (! empty($arrayfields['cd.date_ouverture']['checked']))
|
||||
{
|
||||
print '<td align="center">'.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').'</td>';
|
||||
print '<td align="center">'.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture), 'dayhour'):' ').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// End date
|
||||
if (! empty($arrayfields['cd.date_fin_validite']['checked']))
|
||||
{
|
||||
print '<td align="center">'.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' ');
|
||||
print '<td align="center">'.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite), 'dayhour'):' ');
|
||||
if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5)
|
||||
{
|
||||
$warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24;
|
||||
@ -658,9 +659,10 @@ while ($i < min($num,$limit))
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Close date (real end date)
|
||||
if (! empty($arrayfields['cd.date_cloture']['checked']))
|
||||
{
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_cloture)).'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_cloture), 'dayhour').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ if ($action == 'add' && ! empty($permissiontoadd))
|
||||
if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field
|
||||
|
||||
$object->$key=$value;
|
||||
if ($val['notnull'] > 0 && $object->$key == '')
|
||||
if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default']))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors');
|
||||
@ -118,7 +118,7 @@ if ($action == 'update' && ! empty($permissiontoadd))
|
||||
if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field
|
||||
|
||||
$object->$key=$value;
|
||||
if ($val['notnull'] > 0 && $object->$key == '')
|
||||
if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default']))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors');
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
|
||||
// $mysoc must be defined
|
||||
// $id must be defined
|
||||
// $paramname must be defined
|
||||
// $mode must be defined (used to know the automatic BCC to add)
|
||||
// $paramname may be defined
|
||||
// $autocopy may be defined (used to know the automatic BCC to add)
|
||||
// $trigger_name must be set (can be '')
|
||||
// $actiontypecode can be set
|
||||
// $object and $uobject may be defined
|
||||
|
||||
@ -222,13 +222,14 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked':'').'> '.$langs->trans("NumberOfBillsByMonth");
|
||||
$stringtoshow.=' ';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked':'').'> '.$langs->trans("AmountOfBillsByMonthHT");
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='<input class="reposition inline-block valigntextbottom" type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='</form>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
|
||||
@ -219,13 +219,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked':'').'> '.$langs->trans("NumberOfBillsByMonth");
|
||||
$stringtoshow.=' ';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked':'').'> '.$langs->trans("AmountOfBillsByMonthHT");
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow.='<input type="image" class="inline-block valigntextbottom" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='<input type="image" class="reposition inline-block valigntextbottom" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='</form>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
|
||||
@ -218,13 +218,14 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked':'').'> '.$langs->trans("NumberOfOrdersByMonth");
|
||||
$stringtoshow.=' ';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked':'').'> '.$langs->trans("AmountOfOrdersByMonthHT");
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='<input type="image" class="reposition inline-block valigntextbottom" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='</form>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
|
||||
@ -217,13 +217,14 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked':'').'> '.$langs->trans("NumberOfOrdersByMonth");
|
||||
$stringtoshow.=' ';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked':'').'> '.$langs->trans("AmountOfOrdersByMonthHT");
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='<input type="image" class="reposition inline-block valigntextbottom" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='</form>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
|
||||
@ -338,6 +338,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
$stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,showinvoicenb,showpropalnb,showordernb">';
|
||||
if (! empty($conf->facture->enabled) || ! empty($user->rights->facture->lire))
|
||||
{
|
||||
@ -355,7 +356,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
}
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$year.'">';
|
||||
$stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto('','refresh.png','','',1).'">';
|
||||
$stringtoshow.='<input type="image" class="reposition inline-block valigntextbottom" alt="'.$langs->trans("Refresh").'" src="'.img_picto('','refresh.png','','',1).'">';
|
||||
$stringtoshow.='</form>';
|
||||
$stringtoshow.='</div>';
|
||||
|
||||
|
||||
@ -219,13 +219,14 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
$stringtoshow.='<div class="center hideobject divboxfilter" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden
|
||||
$stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow.='<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked':'').'> '.$langs->trans("NumberOfProposalsByMonth");
|
||||
$stringtoshow.=' ';
|
||||
$stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked':'').'> '.$langs->trans("AmountOfProposalsByMonthHT");
|
||||
$stringtoshow.='<br>';
|
||||
$stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='<input type="image" class="reposition inline-block valigntextbottom" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">';
|
||||
$stringtoshow.='</form>';
|
||||
$stringtoshow.='</div>';
|
||||
if ($shownb && $showtot)
|
||||
|
||||
@ -3923,23 +3923,26 @@ abstract class CommonObject
|
||||
$var = true;
|
||||
$i = 0;
|
||||
|
||||
foreach ($this->lines as $line)
|
||||
if (! empty($this->lines))
|
||||
{
|
||||
if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
|
||||
foreach ($this->lines as $line)
|
||||
{
|
||||
if (empty($line->fk_parent_line))
|
||||
if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
|
||||
{
|
||||
$parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
|
||||
$action='';
|
||||
$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if (empty($line->fk_parent_line))
|
||||
{
|
||||
$parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
|
||||
$action='';
|
||||
$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->printOriginLine($line, $var, $restrictlist);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->printOriginLine($line, $var, $restrictlist);
|
||||
}
|
||||
|
||||
$i++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5672,11 +5675,19 @@ abstract class CommonObject
|
||||
elseif ($key == 'status' && method_exists($this, 'getLibStatut')) $value=$this->getLibStatut(3);
|
||||
elseif ($type == 'date')
|
||||
{
|
||||
$value=dol_print_date($value,'day');
|
||||
if(! empty($value)) {
|
||||
$value=dol_print_date($value,'day');
|
||||
} else {
|
||||
$value='';
|
||||
}
|
||||
}
|
||||
elseif ($type == 'datetime')
|
||||
{
|
||||
$value=dol_print_date($value,'dayhour');
|
||||
if(! empty($value)) {
|
||||
$value=dol_print_date($value,'dayhour');
|
||||
} else {
|
||||
$value='';
|
||||
}
|
||||
}
|
||||
elseif ($type == 'double')
|
||||
{
|
||||
@ -6734,7 +6745,7 @@ abstract class CommonObject
|
||||
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]='';
|
||||
|
||||
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
||||
if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key]))
|
||||
if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key]) && is_null($val['default']))
|
||||
{
|
||||
$error++;
|
||||
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
||||
|
||||
@ -347,6 +347,9 @@ class Conf
|
||||
$this->fournisseur->facture=new stdClass();
|
||||
$this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture";
|
||||
$this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp";
|
||||
$this->supplierproposal=new stdClass();
|
||||
$this->supplierproposal->dir_output=$rootfordata."/supplier_proposal";
|
||||
$this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp";
|
||||
$this->fournisseur->payment=new stdClass();
|
||||
$this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment";
|
||||
$this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp";
|
||||
@ -362,6 +365,9 @@ class Conf
|
||||
$this->supplier_invoice->enabled=1;
|
||||
$this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture";
|
||||
$this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp";
|
||||
$this->supplierproposal=new stdClass();
|
||||
$this->supplierproposal->dir_output=$rootfordata."/supplier_proposal";
|
||||
$this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,142 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/class/cookie.class.php
|
||||
* \ingroup core
|
||||
* \brief File of class to manage cookies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage cookies.
|
||||
* This class is used by external module multicompany but will be removed soon only and must not be used by
|
||||
*
|
||||
* @deprecated PHP already provide function to read/store a cookie. No need to use a dedicated class. Also storing sensitive information into cookie is forbidden, so encryption is useless.
|
||||
* If a data is sensitive, it must be stored into database (if we need a long term retention) or into session.
|
||||
*/
|
||||
class DolCookie
|
||||
{
|
||||
private $_myKey;
|
||||
private $_iv;
|
||||
|
||||
var $myCookie;
|
||||
var $myValue;
|
||||
var $myExpire;
|
||||
var $myPath;
|
||||
var $myDomain;
|
||||
var $mySecure;
|
||||
var $cookie;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $key Personnal key
|
||||
* @deprecated
|
||||
*/
|
||||
function __construct($key = '')
|
||||
{
|
||||
$this->_myKey = hash('sha256', $key, true);
|
||||
$this->_iv = md5(md5($this->_myKey));
|
||||
$this->cookie = "";
|
||||
$this->myCookie = "";
|
||||
$this->myValue = "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Encrypt en create the cookie
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _cryptCookie()
|
||||
{
|
||||
if (!empty($this->_myKey) && !empty($this->_iv))
|
||||
{
|
||||
$valuecrypt = base64_encode($this->myValue);
|
||||
$this->cookie = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->_myKey, $valuecrypt, MCRYPT_MODE_CBC, $this->_iv));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->cookie = $this->myValue;
|
||||
}
|
||||
|
||||
setcookie($this->myCookie, $this->cookie, $this->myExpire, $this->myPath, $this->myDomain, $this->mySecure);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrypt the cookie
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _decryptCookie()
|
||||
{
|
||||
if (!empty($this->_myKey) && !empty($this->_iv))
|
||||
{
|
||||
$this->cookie = $_COOKIE[$this->myCookie];
|
||||
$this->myValue = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->_myKey, base64_decode($this->cookie), MCRYPT_MODE_CBC, $this->_iv));
|
||||
|
||||
return(base64_decode($this->myValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
return($_COOKIE[$this->myCookie]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set and create the cookie
|
||||
*
|
||||
* @param string $cookie Cookie name
|
||||
* @param string $value Cookie value
|
||||
* @param integer $expire Expiration
|
||||
* @param string $path Path of cookie
|
||||
* @param string $domain Domain name
|
||||
* @param int $secure 0 or 1
|
||||
* @return void
|
||||
*/
|
||||
public function setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
|
||||
{
|
||||
$this->myCookie = $cookie;
|
||||
$this->myValue = $value;
|
||||
$this->myExpire = $expire;
|
||||
$this->myPath = $path;
|
||||
$this->myDomain = $domain;
|
||||
$this->mySecure = $secure;
|
||||
|
||||
//print 'key='.$this->myKey.' name='.$this->myCookie.' value='.$this->myValue.' expire='.$this->myExpire;
|
||||
|
||||
$this->_cryptCookie();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cookie
|
||||
*
|
||||
* @param string $cookie Cookie name
|
||||
* @return string Decrypted value
|
||||
*/
|
||||
public function getCookie($cookie)
|
||||
{
|
||||
$this->myCookie = $cookie;
|
||||
|
||||
$decryptValue = $this->_decryptCookie();
|
||||
|
||||
return $decryptValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1028,7 +1028,7 @@ class ExtraFields
|
||||
$out.= (((string) $value == (string) $key)?' selected':'');
|
||||
$out.= (!empty($parent)?' parent="'.$parent.'"':'');
|
||||
$out.='>';
|
||||
if ($langfile) $out.=$langs->trans($val);
|
||||
if ($langfile && $val) $out.=$langs->trans($val);
|
||||
else $out.=$val;
|
||||
$out.='</option>';
|
||||
}
|
||||
@ -1492,7 +1492,7 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'select')
|
||||
{
|
||||
if ($langfile) $value=$langs->trans($param['options'][$value]);
|
||||
if ($langfile && $param['options'][$value]) $value=$langs->trans($param['options'][$value]);
|
||||
else $value=$param['options'][$value];
|
||||
}
|
||||
elseif ($type == 'sellist')
|
||||
|
||||
@ -3469,8 +3469,8 @@ class Form
|
||||
if ($selected) {
|
||||
require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php';
|
||||
$bankstatic=new Account($this->db);
|
||||
$bankstatic->fetch($selected);
|
||||
print $bankstatic->getNomUrl(1);
|
||||
$result = $bankstatic->fetch($selected);
|
||||
if ($result) print $bankstatic->getNomUrl(1);
|
||||
} else {
|
||||
print " ";
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015-2017 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015-2017 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -1110,7 +1111,8 @@ class FormMail extends Form
|
||||
elseif ($type_template=='fichinter_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendFichInter"); }
|
||||
elseif ($type_template=='thirdparty') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentThirdparty"); }
|
||||
elseif ($type_template=='user') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentUser"); }
|
||||
|
||||
elseif (!empty($type_template)) { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContent".ucfirst($type_template)); }
|
||||
|
||||
$ret->label = 'default';
|
||||
$ret->lang = $outputlangs->defaultlang;
|
||||
$ret->topic = '';
|
||||
|
||||
@ -113,10 +113,10 @@ class FormTicketsup
|
||||
/**
|
||||
* Show the form to input ticket
|
||||
*
|
||||
* @param string $width Width of form
|
||||
* @param int $withdolfichehead With dol_fiche_head
|
||||
* @return void
|
||||
*/
|
||||
public function showForm($width = '100%')
|
||||
public function showForm($withdolfichehead=0)
|
||||
{
|
||||
global $conf, $langs, $user, $hookmanager;
|
||||
|
||||
@ -140,7 +140,9 @@ class FormTicketsup
|
||||
|
||||
print "\n<!-- Begin form TICKETSUP -->\n";
|
||||
|
||||
print '<form method="POST" style="margin-bottom: 30px;" name="ticketsup" id="form_create_ticket" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">';
|
||||
if ($withdolfichehead) dol_fiche_head(null, 'card', '', 0, '');
|
||||
|
||||
print '<form method="POST" '.($withdolfichehead?'':'style="margin-bottom: 30px;" ').'name="ticketsup" id="form_create_ticket" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="' . $this->action . '">';
|
||||
foreach ($this->param as $key => $value) {
|
||||
@ -148,8 +150,8 @@ class FormTicketsup
|
||||
}
|
||||
print '<input type="hidden" name="fk_user_create" value="' . $this->fk_user_create . '">';
|
||||
|
||||
print '<div class="">';
|
||||
print '<table class="tableticket" width="' . $width . '">';
|
||||
dol_fiche_head('');
|
||||
print '<table class="tableticket centpercent">';
|
||||
|
||||
|
||||
if ($this->withref) {
|
||||
@ -181,7 +183,7 @@ class FormTicketsup
|
||||
print '<tr><td class="titlefield">' . $langs->trans("ThirdParty") . '</td><td>';
|
||||
$events = array();
|
||||
$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||
print $form->select_company($this->withfromsocid, 'socid', '', 1, 1, '', $events);
|
||||
print $form->select_company($this->withfromsocid, 'socid', '', 1, 1, '', $events, 0, 'minwidth200');
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) {
|
||||
$htmlname = 'socid';
|
||||
@ -270,7 +272,7 @@ class FormTicketsup
|
||||
dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
|
||||
$classname = ucfirst($subelement);
|
||||
$objectsrc = new $classname($this->db);
|
||||
$objectsrc->fetch(GETPOST('originid'));
|
||||
$objectsrc->fetch(GETPOST('originid','int'));
|
||||
|
||||
if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
|
||||
$objectsrc->fetch_lines();
|
||||
@ -297,9 +299,12 @@ class FormTicketsup
|
||||
print '</td></tr>';
|
||||
|
||||
// Notify thirdparty at creation
|
||||
print '<tr><td><label for="notify_tiers_at_create">' . $langs->trans("TicketNotifyTiersAtCreation") . '</label></td><td>';
|
||||
print '<input type="checkbox" id="notify_tiers_at_create" name="notify_tiers_at_create"'.($this->withnotifytiersatcreate?' checked="checked"':'').'>';
|
||||
print '</td></tr>';
|
||||
if (empty($this->ispublic))
|
||||
{
|
||||
print '<tr><td><label for="notify_tiers_at_create">' . $langs->trans("TicketNotifyTiersAtCreation") . '</label></td><td>';
|
||||
print '<input type="checkbox" id="notify_tiers_at_create" name="notify_tiers_at_create"'.($this->withnotifytiersatcreate?' checked="checked"':'').'>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// TITLE
|
||||
if ($this->withtitletopic) {
|
||||
@ -394,6 +399,8 @@ class FormTicketsup
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
if ($withdolfichehead) dol_fiche_end();
|
||||
|
||||
print '<center>';
|
||||
print '<input class="button" type="submit" name="add_ticket" value="' . $langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")) . '" />';
|
||||
|
||||
@ -436,7 +443,7 @@ class FormTicketsup
|
||||
|
||||
$ticketstat->loadCacheTypesTickets();
|
||||
|
||||
print '<select id="select' . $htmlname . '" class="flat select_tickettype'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
|
||||
print '<select id="select' . $htmlname . '" class="flat minwidth200'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
|
||||
if ($empty) {
|
||||
print '<option value=""> </option>';
|
||||
}
|
||||
@ -536,7 +543,7 @@ class FormTicketsup
|
||||
|
||||
$ticketstat->loadCacheCategoriesTickets();
|
||||
|
||||
print '<select id="select' . $htmlname . '" class="flat select_ticketcategory'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
|
||||
print '<select id="select' . $htmlname . '" class="flat minwidth150'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
|
||||
if ($empty) {
|
||||
print '<option value=""> </option>';
|
||||
}
|
||||
@ -605,7 +612,7 @@ class FormTicketsup
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
|
||||
print ajax_combobox('select'.$htmlname);
|
||||
print ajax_combobox('select'.$htmlname,'',0,0,'off');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -637,7 +644,7 @@ class FormTicketsup
|
||||
|
||||
$ticketstat->loadCacheSeveritiesTickets();
|
||||
|
||||
print '<select id="select' . $htmlname . '" class="flat select_ticketseverity'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
|
||||
print '<select id="select' . $htmlname . '" class="flat minwidth150'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
|
||||
if ($empty) {
|
||||
print '<option value=""> </option>';
|
||||
}
|
||||
@ -857,7 +864,7 @@ class FormTicketsup
|
||||
// Destinataires
|
||||
print '<tr class="email_line"><td>' . $langs->trans('MailRecipients') . '</td><td colspan="2">';
|
||||
$ticketstat = new Ticketsup($this->db);
|
||||
$res = $ticketstat->fetch('', $this->track_id);
|
||||
$res = $ticketstat->fetch('', '', $this->track_id);
|
||||
if ($res) {
|
||||
// Retrieve email of all contacts (internal and external)
|
||||
$contacts = $ticketstat->getInfosTicketInternalContact();
|
||||
@ -880,7 +887,7 @@ class FormTicketsup
|
||||
$ticketstat->socid = $ticketstat->fk_soc;
|
||||
$ticketstat->fetch_thirdparty();
|
||||
|
||||
if (!in_array($ticketstat->thirdparty->email, $sendto)) {
|
||||
if (is_array($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) {
|
||||
$sendto[] = $ticketstat->thirdparty->email . '(' . $langs->trans('Customer') . ')';
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,16 +131,29 @@ if ($conf->browser->layout != 'phone')
|
||||
' . "\n";
|
||||
}
|
||||
|
||||
// Code to manage reposition
|
||||
print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n";
|
||||
print '
|
||||
jQuery(document).ready(function() {
|
||||
/* If page_y set, we set scollbar with it */
|
||||
page_y=getParameterByName(\'page_y\', 0); if (page_y > 0) $(\'html, body\').scrollTop(page_y);
|
||||
/* Set handler to add page_y param on some a href links */
|
||||
page_y=getParameterByName(\'page_y\', 0); /* search in GET parameter */
|
||||
if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */
|
||||
console.log("page_y found is "+page_y);
|
||||
if (page_y > 0) $(\'html, body\').scrollTop(page_y);
|
||||
|
||||
/* Set handler to add page_y param on output (click on href links or submit button) */
|
||||
jQuery(".reposition").click(function() {
|
||||
var page_y = $(document).scrollTop();
|
||||
this.href=this.href+\'&page_y=\'+page_y;
|
||||
console.log("We click on tag with .reposition class. this.ref is now "+this.href)
|
||||
});
|
||||
var page_y = $(document).scrollTop();
|
||||
if (this.href)
|
||||
{
|
||||
this.href=this.href+\'&page_y=\'+page_y;
|
||||
console.log("We click on tag with .reposition class. this.ref is now "+this.href);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update form field page_y with value "+page_y);
|
||||
jQuery("input[type=hidden][name=page_y]").val(page_y);
|
||||
}
|
||||
});
|
||||
});'."\n";
|
||||
|
||||
|
||||
@ -3906,16 +3906,20 @@ function dol_print_error($db='',$error='',$errors=null)
|
||||
* @param string $errormessage Complete error message
|
||||
* @param array $errormessages Array of error messages
|
||||
* @param string $morecss More css
|
||||
* @param string $email Email
|
||||
* @return void
|
||||
*/
|
||||
function dol_print_error_email($prefixcode, $errormessage='', $errormessages=array(), $morecss='error')
|
||||
function dol_print_error_email($prefixcode, $errormessage='', $errormessages=array(), $morecss='error', $email='')
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
if (empty($email)) $email=$conf->global->MAIN_INFO_SOCIETE_MAIL;
|
||||
|
||||
$langs->load("errors");
|
||||
$now=dol_now();
|
||||
|
||||
print '<br><div class="center login_main_message"><div class="'.$morecss.'">';
|
||||
print $langs->trans("ErrorContactEMail", $conf->global->MAIN_INFO_SOCIETE_MAIL, $prefixcode.dol_print_date($now,'%Y%m%d'));
|
||||
print $langs->trans("ErrorContactEMail", $email, $prefixcode.dol_print_date($now,'%Y%m%d'));
|
||||
if ($errormessage) print '<br><br>'.$errormessage;
|
||||
if (is_array($errormessages) && count($errormessages))
|
||||
{
|
||||
@ -6884,6 +6888,10 @@ function printCommonFooter($zone='private')
|
||||
if ($zone == 'private') print "\n".'<!-- Common footer for private page -->'."\n";
|
||||
else print "\n".'<!-- Common footer for public page -->'."\n";
|
||||
|
||||
// A div to store page_y POST parameter so we can read it using javascript
|
||||
print "\n<!-- A div to store page_y POST paramater -->\n";
|
||||
print '<div id="page_y" style="display: none;">'.$_POST['page_y'].'</div>'."\n";
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printCommonFooter',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
if (empty($reshook))
|
||||
|
||||
@ -27,44 +27,75 @@
|
||||
|
||||
|
||||
/**
|
||||
* Encode a string with base 64 algorithm + specific change
|
||||
* Code of this function is useless and we should use base64_encode only instead
|
||||
* Encode a string with base 64 algorithm + specific delta change.
|
||||
*
|
||||
* @param string $chain string to encode
|
||||
* @param string $key rule to use for delta ('0', '1' or 'myownkey')
|
||||
* @return string encoded string
|
||||
* @see dol_decode
|
||||
*/
|
||||
function dol_encode($chain)
|
||||
function dol_encode($chain, $key='1')
|
||||
{
|
||||
$strlength=dol_strlen($chain);
|
||||
for ($i=0; $i < $strlength; $i++)
|
||||
if (is_numeric($key) && $key == '1') // rule 1 is offset of 17 for char
|
||||
{
|
||||
$output_tab[$i] = chr(ord(substr($chain,$i,1))+17);
|
||||
$strlength=dol_strlen($chain);
|
||||
for ($i=0; $i < $strlength; $i++)
|
||||
{
|
||||
$output_tab[$i] = chr(ord(substr($chain,$i,1))+17);
|
||||
}
|
||||
$chain = implode("",$output_tab);
|
||||
}
|
||||
elseif ($key)
|
||||
{
|
||||
$result='';
|
||||
$strlength=dol_strlen($chain);
|
||||
for ($i=0; $i < $strlength; $i++)
|
||||
{
|
||||
$keychar = substr($key, ($i % strlen($key))-1, 1);
|
||||
$result.= chr(ord(substr($chain,$i,1))+(ord($keychar)-65));
|
||||
}
|
||||
$chain=$result;
|
||||
}
|
||||
|
||||
$string_coded = base64_encode(implode("",$output_tab));
|
||||
return $string_coded;
|
||||
return base64_encode($chain);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a base 64 encoded + specific string.
|
||||
* Decode a base 64 encoded + specific delta change.
|
||||
* This function is called by filefunc.inc.php at each page call.
|
||||
* Code of this function is useless and we should use base64_decode only instead
|
||||
*
|
||||
* @param string $chain string to decode
|
||||
* @param string $key rule to use for delta ('0', '1' or 'myownkey')
|
||||
* @return string decoded string
|
||||
* @see dol_encode
|
||||
*/
|
||||
function dol_decode($chain)
|
||||
function dol_decode($chain, $key='1')
|
||||
{
|
||||
$chain = base64_decode($chain);
|
||||
|
||||
$strlength=dol_strlen($chain);
|
||||
for($i=0; $i < $strlength;$i++)
|
||||
if (is_numeric($key) && $key == '1') // rule 1 is offset of 17 for char
|
||||
{
|
||||
$output_tab[$i] = chr(ord(substr($chain,$i,1))-17);
|
||||
$strlength=dol_strlen($chain);
|
||||
for ($i=0; $i < $strlength;$i++)
|
||||
{
|
||||
$output_tab[$i] = chr(ord(substr($chain,$i,1))-17);
|
||||
}
|
||||
|
||||
$chain = implode("",$output_tab);
|
||||
}
|
||||
elseif ($key)
|
||||
{
|
||||
$result='';
|
||||
$strlength=dol_strlen($chain);
|
||||
for ($i=0; $i < $strlength; $i++)
|
||||
{
|
||||
$keychar = substr($key, ($i % strlen($key))-1, 1);
|
||||
$result.= chr(ord(substr($chain, $i, 1))-(ord($keychar)-65));
|
||||
}
|
||||
$chain=$result;
|
||||
}
|
||||
|
||||
$string_decoded = implode("",$output_tab);
|
||||
return $string_decoded;
|
||||
return $chain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ function showlogo()
|
||||
$urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.png';
|
||||
}
|
||||
print '<center>';
|
||||
print '<a href="' . ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE : dol_buildpath('/ticketsup/public/index.php', 1)) . '"><img alt="Logo" id="logosubscribe" title="" src="' . $urllogo . '" style="max-width: 440px" /></a><br>';
|
||||
print '<a href="' . ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE : dol_buildpath('/public/ticketsup/index.php', 1)) . '"><img alt="Logo" id="logosubscribe" title="" src="' . $urllogo . '" style="max-width: 440px" /></a><br>';
|
||||
print '<strong>' . ($conf->global->TICKETS_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKETS_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . '</strong>';
|
||||
print '</center><br>';
|
||||
}
|
||||
|
||||
@ -74,7 +74,9 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
|
||||
$texte.= '<table class="nobordernopadding" width="100%">';
|
||||
$s1= $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="'.$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER.'">',$tooltip,1,1);
|
||||
$s2= $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="'.$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER.'">',$tooltip,1,1);
|
||||
$texte.= '<tr><td>'.$langs->trans("ModuleCompanyCode".$this->name,$s1,$s2)."<br>\n";
|
||||
$texte.= '<tr><td>';
|
||||
$texte.=$langs->trans("ModuleCompanyCodeCustomer".$this->name,$s2)."<br>\n";
|
||||
$texte.=$langs->trans("ModuleCompanyCodeSupplier".$this->name,$s1)."<br>\n";
|
||||
$texte.= '</td>';
|
||||
$texte.= '<td align="left"> <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||
$texte.= '</tr></table>';
|
||||
@ -93,7 +95,11 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
|
||||
*/
|
||||
function getExample($langs,$objsoc=0,$type=-1)
|
||||
{
|
||||
return $this->prefixsupplieraccountancycode.'SUPPCODE'."<br>\n".$this->prefixcustomeraccountancycode.'CUSTCODE';
|
||||
$s='';
|
||||
$s.=$this->prefixcustomeraccountancycode.'CUSTCODE';
|
||||
$s.="<br>\n";
|
||||
$s.=$this->prefixsupplieraccountancycode.'SUPPCODE';
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
@ -107,24 +113,43 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
|
||||
*/
|
||||
function get_code($db, $societe, $type='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$i = 0;
|
||||
$this->db = $db;
|
||||
|
||||
dol_syslog("mod_codecompta_aquarium::get_code search code for type=".$type." company=".(! empty($societe->name)?$societe->name:''));
|
||||
|
||||
// Regle gestion compte compta
|
||||
$codetouse='';
|
||||
if ($type == 'customer')
|
||||
{
|
||||
$codetouse = $this->prefixcustomeraccountancycode;
|
||||
$codetouse.= (! empty($societe->code_client)?$societe->code_client:'CUSTCODE');
|
||||
$codetouse=(! empty($societe->code_client)?$societe->code_client:'CUSTCODE');
|
||||
$prefix = $this->prefixcustomeraccountancycode;
|
||||
}
|
||||
else if ($type == 'supplier')
|
||||
{
|
||||
$codetouse = $this->prefixsupplieraccountancycode;
|
||||
$codetouse.= (! empty($societe->code_fournisseur)?$societe->code_fournisseur:'SUPPCODE');
|
||||
$codetouse=(! empty($societe->code_fournisseur)?$societe->code_fournisseur:'SUPPCODE');
|
||||
$prefix = $this->prefixsupplieraccountancycode;
|
||||
}
|
||||
$codetouse=strtoupper(preg_replace('/([^a-z0-9])/i','',$codetouse));
|
||||
else
|
||||
{
|
||||
$this->error = 'Bad value for parameter type';
|
||||
return -1;
|
||||
}
|
||||
|
||||
//$conf->global->COMPANY_AQUARIUM_CLEAN_REGEX='^..(..)..';
|
||||
|
||||
// Remove special char if COMPANY_AQUARIUM_REMOVE_SPECIAL is set to 1 or not set (default)
|
||||
if (! isset($conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL) || ! empty($conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL)) $codetouse=preg_replace('/([^a-z0-9])/i','',$codetouse);
|
||||
// Remove special alpha if COMPANY_AQUARIUM_REMOVE_ALPHA is set to 1
|
||||
if (! empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $codetouse=preg_replace('/([a-z])/i','',$codetouse);
|
||||
// Apply a regex replacement pattern if COMPANY_AQUARIUM_REMOVE_ALPHA is set to 1
|
||||
if (! empty($conf->global->COMPANY_AQUARIUM_CLEAN_REGEX)) // Example: $conf->global->COMPANY_AQUARIUM_CLEAN_REGEX='^..(..)..';
|
||||
{
|
||||
$codetouse=preg_replace('/'.$conf->global->COMPANY_AQUARIUM_CLEAN_REGEX.'/','\1\2\3',$codetouse);
|
||||
}
|
||||
|
||||
$codetouse=$prefix.strtoupper($codetouse);
|
||||
|
||||
$is_dispo = $this->verif($db, $codetouse, $societe, $type);
|
||||
if (! $is_dispo)
|
||||
|
||||
@ -173,7 +173,7 @@ $langs->load("modulebuilder");
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Position -->
|
||||
<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOST('pos','int'); ?>"></td></tr>
|
||||
<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOSTISSET('pos')?GETPOST('pos','int'):100; ?>"></td></tr>
|
||||
<!-- Language file -->
|
||||
<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" id="langfile" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag(GETPOST('langfile','alpha')); ?>"></td></tr>
|
||||
<!-- Computed Value -->
|
||||
|
||||
@ -113,7 +113,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
||||
{
|
||||
$fieldid='id';
|
||||
if ($object->table_element == 'societe') $fieldid='socid';
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
||||
print '<td align="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
|
||||
|
||||
@ -110,189 +110,209 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
||||
case 'TICKET_ASSIGNED':
|
||||
dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
|
||||
|
||||
if ($object->fk_user_assign > 0 && $object->fk_user_assign != $user->id) {
|
||||
if ($object->fk_user_assign > 0 && $object->fk_user_assign != $user->id)
|
||||
{
|
||||
$userstat = new User($this->db);
|
||||
$res = $userstat->fetch($object->fk_user_assign);
|
||||
if ($res) {
|
||||
// Send email to assigned user
|
||||
$subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketAssignedToYou');
|
||||
$message = '<p>' . $langs->transnoentities('TicketAssignedEmailBody', $object->track_id, dolGetFirstLastname($user->firstname, $user->lastname)) . "</p>";
|
||||
$message .= '<ul><li>' . $langs->trans('Title') . ' : ' . $object->subject . '</li>';
|
||||
$message .= '<li>' . $langs->trans('Type') . ' : ' . $object->type_label . '</li>';
|
||||
$message .= '<li>' . $langs->trans('Category') . ' : ' . $object->category_label . '</li>';
|
||||
$message .= '<li>' . $langs->trans('Severity') . ' : ' . $object->severity_label . '</li>';
|
||||
// Extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
foreach ($object->array_options as $key => $value) {
|
||||
$message .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
|
||||
if ($res > 0)
|
||||
{
|
||||
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS))
|
||||
{
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
// Send email to assigned user
|
||||
$subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketAssignedToYou');
|
||||
$message = '<p>' . $langs->transnoentities('TicketAssignedEmailBody', $object->track_id, dolGetFirstLastname($user->firstname, $user->lastname)) . "</p>";
|
||||
$message .= '<ul><li>' . $langs->trans('Title') . ' : ' . $object->subject . '</li>';
|
||||
$message .= '<li>' . $langs->trans('Type') . ' : ' . $object->type_label . '</li>';
|
||||
$message .= '<li>' . $langs->trans('Category') . ' : ' . $object->category_label . '</li>';
|
||||
$message .= '<li>' . $langs->trans('Severity') . ' : ' . $object->severity_label . '</li>';
|
||||
// Extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
foreach ($object->array_options as $key => $value) {
|
||||
$message .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
$message .= '</ul>';
|
||||
$message .= '<p>' . $langs->trans('Message') . ' : <br>' . $object->message . '</p>';
|
||||
$message .= '<p><a href="' . dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
|
||||
|
||||
$sendto = $userstat->email;
|
||||
$from = dolGetFirstLastname($user->firstname, $user->lastname) . '<' . $user->email . '>';
|
||||
|
||||
$message = dol_nl2br($message);
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
}
|
||||
|
||||
$message .= '</ul>';
|
||||
$message .= '<p>' . $langs->trans('Message') . ' : <br>' . $object->message . '</p>';
|
||||
$message .= '<p><a href="' . dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
|
||||
|
||||
$sendto = $userstat->email;
|
||||
$from = dolGetFirstLastname($user->firstname, $user->lastname) . '<' . $user->email . '>';
|
||||
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
$message = dol_nl2br($message);
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
|
||||
$ok = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error = $userstat->error;
|
||||
$this->errors = $userstat->errors;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'TICKET_CREATE':
|
||||
dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
|
||||
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
$langs->load('ticketsup');
|
||||
|
||||
$object->fetch('', $object->track_id);
|
||||
$object->fetch('', $object->track_id); // Should be useless
|
||||
|
||||
/* Send email to admin */
|
||||
$sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO;
|
||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin');
|
||||
$message_admin= $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n";
|
||||
$message_admin.='<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('From').' : '.( $object->email_from ? $object->email_from : ( $object->fk_user_create > 0 ? $langs->trans('Internal') : '') ).'</li>';
|
||||
// Extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
foreach ($object->array_options as $key => $value) {
|
||||
$message_admin.='<li>'.$langs->trans($key).' : '.$value.'</li>';
|
||||
|
||||
// Send email to notification email
|
||||
|
||||
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketsupemail']))
|
||||
{
|
||||
$sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO;
|
||||
|
||||
if ($sendto)
|
||||
{
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
/* Send email to admin */
|
||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin');
|
||||
$message_admin= $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n";
|
||||
$message_admin.='<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('From').' : '.( $object->email_from ? $object->email_from : ( $object->fk_user_create > 0 ? $langs->trans('Internal') : '') ).'</li>';
|
||||
// Extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
foreach ($object->array_options as $key => $value) {
|
||||
$message_admin.='<li>'.$langs->trans($key).' : '.$value.'</li>';
|
||||
}
|
||||
}
|
||||
$message_admin.='</ul>';
|
||||
|
||||
if ($object->fk_soc > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$message_admin.='<p>'.$langs->trans('Company'). ' : '.$object->thirdparty->name.'</p>';
|
||||
}
|
||||
|
||||
$message_admin.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$message_admin.='<p><a href="'.dol_buildpath('/ticketsup/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$replyto = $from;
|
||||
|
||||
$message_admin = dol_nl2br($message_admin);
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
dol_syslog($mailfile->error, LOG_DEBUG);
|
||||
} else {
|
||||
$result=$mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send email to customer
|
||||
|
||||
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketsupemail']) && $object->notify_tiers_at_create)
|
||||
{
|
||||
$sendto = '';
|
||||
if (empty($user->socid) && empty($user->email)) {
|
||||
$object->fetch_thirdparty();
|
||||
$sendto = $object->thirdparty->email;
|
||||
} else {
|
||||
$sendto = $user->email;
|
||||
}
|
||||
|
||||
if ($sendto) {
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectCustomer');
|
||||
$message_customer= $langs->transnoentities('TicketNewEmailBodyCustomer', $object->track_id)."\n\n";
|
||||
$message_customer.='<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||
$message_customer.='<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
|
||||
$message_customer.='<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
|
||||
$message_customer.='<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
|
||||
|
||||
// Extrafields
|
||||
foreach ($this->attributes[$object->table_element]['label'] as $key => $value)
|
||||
{
|
||||
$enabled = 1;
|
||||
if ($enabled && isset($this->attributes[$object->table_element]['list'][$key]))
|
||||
{
|
||||
$enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
|
||||
}
|
||||
$perms = 1;
|
||||
if ($perms && isset($this->attributes[$object->table_element]['perms'][$key]))
|
||||
{
|
||||
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
|
||||
}
|
||||
|
||||
$qualified = true;
|
||||
if (empty($enabled)) $qualified = false;
|
||||
if (empty($perms)) $qualified = false;
|
||||
|
||||
if ($qualified) $message_customer.='<li>'.$langs->trans($key).' : '.$value.'</li>';
|
||||
}
|
||||
|
||||
$message_customer.='</ul>';
|
||||
$message_customer.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/public/ticketsup/view.php', 2)).'?track_id='.$object->track_id;
|
||||
$message_customer.='<p>' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
|
||||
$message_customer.='<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$replyto = $from;
|
||||
|
||||
$message_customer = dol_nl2br($message_customer);
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message_customer, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
dol_syslog($mailfile->error, LOG_DEBUG);
|
||||
} else {
|
||||
$result=$mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
}
|
||||
$message_admin.='</ul>';
|
||||
|
||||
if ($object->fk_soc > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$message_admin.='<p>'.$langs->trans('Company'). ' : '.$object->thirdparty->name.'</p>';
|
||||
}
|
||||
|
||||
$message_admin.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$message_admin.='<p><a href="'.dol_buildpath('/ticketsup/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$replyto = $from;
|
||||
|
||||
$message_admin = dol_nl2br($message_admin);
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
dol_syslog($mailfile->error, LOG_DEBUG);
|
||||
} else {
|
||||
$result=$mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
|
||||
/* Send email to customer */
|
||||
$sendto = '';
|
||||
if (empty($user->socid) && empty($user->email)) {
|
||||
$object->fetch_thirdparty();
|
||||
$sendto = $object->thirdparty->email;
|
||||
} else {
|
||||
$sendto = $user->email;
|
||||
}
|
||||
|
||||
if ($sendto && $object->notify_tiers_at_create) {
|
||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectCustomer');
|
||||
$message_customer= $langs->transnoentities('TicketNewEmailBodyCustomer', $object->track_id)."\n\n";
|
||||
$message_customer.='<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||
$message_customer.='<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
|
||||
$message_customer.='<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
|
||||
$message_customer.='<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
|
||||
|
||||
// Extrafields
|
||||
foreach ($this->attributes[$object->table_element]['label'] as $key => $value)
|
||||
{
|
||||
$enabled = 1;
|
||||
if ($enabled && isset($this->attributes[$object->table_element]['list'][$key]))
|
||||
{
|
||||
$enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
|
||||
}
|
||||
$perms = 1;
|
||||
if ($perms && isset($this->attributes[$object->table_element]['perms'][$key]))
|
||||
{
|
||||
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
|
||||
}
|
||||
|
||||
$qualified = true;
|
||||
if (empty($enabled)) $qualified = false;
|
||||
if (empty($perms)) $qualified = false;
|
||||
|
||||
if ($qualified) $message_customer.='<li>'.$langs->trans($key).' : '.$value.'</li>';
|
||||
}
|
||||
|
||||
|
||||
$message_customer.='</ul>';
|
||||
$message_customer.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/ticketsup/public/view.php', 2)).'?track_id='.$object->track_id;
|
||||
$message_customer.='<p>' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
|
||||
$message_customer.='<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
|
||||
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$replyto = $from;
|
||||
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
$message_customer = dol_nl2br($message_customer);
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message_customer, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
dol_syslog($mailfile->error, LOG_DEBUG);
|
||||
} else {
|
||||
$result=$mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
$ok = 1;
|
||||
|
||||
break;
|
||||
|
||||
case 'TICKET_DELETE':
|
||||
|
||||
@ -1068,9 +1068,16 @@ class Cronjob extends CommonObject
|
||||
if ($result === false || (! is_bool($result) && $result != 0))
|
||||
{
|
||||
$langs->load("errors");
|
||||
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR);
|
||||
$this->error = $object->error?$object->error:$langs->trans('ErrorUnknown');
|
||||
$this->lastoutput = ($object->output?$object->output."\n":"").$this->error;
|
||||
|
||||
$errmsg='';
|
||||
if (! is_array($object->errors) || ! in_array($object->error, $object->errors)) $errmsg.=$object->error;
|
||||
if (is_array($object->errors) && count($object->errors)) $errmsg.=($errmsg?', '.$errmsg:'').join(', ',$object->errors);
|
||||
if (empty($errmsg)) $errmsg=$langs->trans('ErrorUnknown');
|
||||
|
||||
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$errmsg, LOG_ERR);
|
||||
|
||||
$this->error = $errmsg;
|
||||
$this->lastoutput = ($object->output?$object->output."\n":"").$errmsg;
|
||||
$this->lastresult = is_numeric($result)?$result:-1;
|
||||
$retval = $this->lastresult;
|
||||
$error++;
|
||||
|
||||
@ -446,7 +446,8 @@ DisplayCompanyInfo=Display company address
|
||||
DisplayCompanyManagers=Display manager names
|
||||
DisplayCompanyInfoAndManagers=Display company address and manager names
|
||||
EnableAndSetupModuleCron=If you want to have this recurring invoice beeing generated automatically, module *%s* must be enabled and correctly setup. Otherwise, generation of invoices must be done manually from this template with button *Create*. Note that even if you enabled automatic generation, you can still safely launch manual generation. Duplicates generation for same period are not possible.
|
||||
ModuleCompanyCodeAquarium=Return an accounting code built by:<br>%s followed by third party supplier code for a supplier accounting code,<br>%s followed by third party customer code for a customer accounting code.
|
||||
ModuleCompanyCodeCustomerAquarium=%s followed by third party customer code for a customer accounting code
|
||||
ModuleCompanyCodeSupplierAquarium=%s followed by third party supplier code for a supplier accounting code
|
||||
ModuleCompanyCodePanicum=Return an empty accounting code.
|
||||
ModuleCompanyCodeDigitaria=Accounting code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code.
|
||||
Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).<br>Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required.
|
||||
@ -1721,19 +1722,19 @@ FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced)
|
||||
ExpectedChecksum=Expected Checksum
|
||||
CurrentChecksum=Current Checksum
|
||||
ForcedConstants=Required constant values
|
||||
MailToSendProposal=To send customer proposal
|
||||
MailToSendOrder=To send customer order
|
||||
MailToSendInvoice=To send customer invoice
|
||||
MailToSendShipment=To send shipment
|
||||
MailToSendIntervention=To send intervention
|
||||
MailToSendSupplierRequestForQuotation=To send quotation request to supplier
|
||||
MailToSendSupplierOrder=To send supplier order
|
||||
MailToSendSupplierInvoice=To send supplier invoice
|
||||
MailToSendContract=To send a contract
|
||||
MailToThirdparty=To send email from third party page
|
||||
MailToMember=To send email from member page
|
||||
MailToUser=To send email from user page
|
||||
MailToProject= To send email from project page
|
||||
MailToSendProposal=Customer proposals
|
||||
MailToSendOrder=Customer orders
|
||||
MailToSendInvoice=Customer invoices
|
||||
MailToSendShipment=Shipments
|
||||
MailToSendIntervention=Interventions
|
||||
MailToSendSupplierRequestForQuotation=Supplier quotations
|
||||
MailToSendSupplierOrder=Supplier orders
|
||||
MailToSendSupplierInvoice=Supplier invoices
|
||||
MailToSendContract=Contracts
|
||||
MailToThirdparty=Third parties
|
||||
MailToMember=Members
|
||||
MailToUser=Users
|
||||
MailToProject=Projects page
|
||||
ByDefaultInList=Show by default on list view
|
||||
YouUseLastStableVersion=You use the latest stable version
|
||||
TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites)
|
||||
|
||||
@ -5,7 +5,8 @@ CountryIT=Italy
|
||||
CountryES=Spain
|
||||
CountryDE=Germany
|
||||
CountryCH=Switzerland
|
||||
CountryGB=Great Britain
|
||||
# Warning, country code GB is for United Kingdom. UK Does not exists as country code in ISO standard.
|
||||
CountryGB=United Kingdom
|
||||
CountryUK=United Kingdom
|
||||
CountryIE=Ireland
|
||||
CountryCN=China
|
||||
|
||||
@ -115,8 +115,6 @@ TicketsShowCompanyLogo=Afficher le logo de la société dans l'interface publiqu
|
||||
TicketsShowCompanyLogoHelp=Enable this option to hide the logo of the main company in the pages of the public interface
|
||||
TicketsEmailAlsoSendToMainAddress=Also send notification to main email address
|
||||
TicketsEmailAlsoSendToMainAddressHelp=Enable this option to send an email to "Notification email from" address (see setup below)
|
||||
TicketsShowExtrafieldsIntoPublicArea=Show Extras fields in the public interface
|
||||
TicketsShowExtrafieldsIntoPublicAreaHelp=When this option is enabled, additional attributes defined on the tickets will be shown in the public interface of ticket creation.
|
||||
TicketsLimitViewAssignedOnly=Restrict the display to tickets assigned to the current user (not effective for external users, always be limited to the thirdparty they depend on)
|
||||
TicketsLimitViewAssignedOnlyHelp=Seuls les tickets affectés à l'utilisateur actuel seront visibles. Ne s'applique pas à un utilisateur disposant de droits de gestion des tickets.
|
||||
TicketsActivatePublicInterface=Activer l'interface publique
|
||||
|
||||
@ -198,7 +198,7 @@ if (! empty($_POST["DOL_AUTOSET_COOKIE"]))
|
||||
{
|
||||
$tmpautoset=explode(':',$_POST["DOL_AUTOSET_COOKIE"],2);
|
||||
$tmplist=explode(',',$tmpautoset[1]);
|
||||
$cookiearrayvalue='';
|
||||
$cookiearrayvalue=array();
|
||||
foreach ($tmplist as $tmpkey)
|
||||
{
|
||||
$postkey=$tmpautoset[0].'_'.$tmpkey;
|
||||
|
||||
@ -42,7 +42,7 @@ $action=GETPOST('action','alpha');
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'yesno', 0, '', $conf->entity) > 0)
|
||||
@ -56,7 +56,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_(.*)/',$action,$reg))
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
|
||||
@ -17,9 +17,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Display public form to add new ticket
|
||||
*
|
||||
* \ingroup ticketsup
|
||||
* \file htdocs/public/ticketsup/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Display public form to add new ticket
|
||||
*/
|
||||
if (!defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@ -75,7 +75,7 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Add file in email form
|
||||
if (GETPOST('addfile') && !GETPOST('add_ticket')) {
|
||||
////$res = $object->fetch('',GETPOST('track_id'));
|
||||
////$res = $object->fetch('','',GETPOST('track_id'));
|
||||
////if($res > 0)
|
||||
////{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
@ -93,9 +93,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) {
|
||||
|
||||
// Remove file
|
||||
if (GETPOST('removedfile') && !GETPOST('add_ticket')) {
|
||||
////$res = $object->fetch('',GETPOST('track_id'));
|
||||
////if($res > 0)
|
||||
////{
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
|
||||
// Set tmp directory
|
||||
@ -103,9 +101,8 @@ if (GETPOST('removedfile') && !GETPOST('add_ticket')) {
|
||||
$upload_dir_tmp = $vardir . '/temp';
|
||||
|
||||
// TODO Delete only files that was uploaded from email form
|
||||
dol_remove_file_process($_POST['removedfile'], 0);
|
||||
dol_remove_file_process($_POST['removedfile'], 0, 0);
|
||||
$action = 'create_ticket';
|
||||
////}
|
||||
}
|
||||
if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
$error = 0;
|
||||
@ -130,11 +127,11 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!GETPOST("subject")) {
|
||||
if (!GETPOST("subject","none")) {
|
||||
$error++;
|
||||
array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")));
|
||||
$action = '';
|
||||
} elseif (!GETPOST("message")) {
|
||||
} elseif (!GETPOST("message","none")) {
|
||||
$error++;
|
||||
array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("message")));
|
||||
$action = '';
|
||||
@ -152,13 +149,13 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
|
||||
$object->track_id = generate_random_id(16);
|
||||
|
||||
$object->subject = GETPOST("subject");
|
||||
$object->message = GETPOST("message");
|
||||
$object->subject = GETPOST("subject","none");
|
||||
$object->message = GETPOST("message","none");
|
||||
$object->origin_email = $origin_email;
|
||||
|
||||
$object->type_code = GETPOST("type_code");
|
||||
$object->category_code = GETPOST("category_code");
|
||||
$object->severity_code = GETPOST("severity_code");
|
||||
$object->type_code = GETPOST("type_code", 'az09');
|
||||
$object->category_code = GETPOST("category_code", 'az09');
|
||||
$object->severity_code = GETPOST("severity_code", 'az09');
|
||||
if (is_array($searched_companies)) {
|
||||
$object->fk_soc = $searched_companies[0]->id;
|
||||
}
|
||||
@ -175,7 +172,10 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
if (!is_object($user)) {
|
||||
$user = new User($db);
|
||||
}
|
||||
$id = $object->create($user, 1); // Disable trigger for email (send by this page)
|
||||
|
||||
$object->context['disableticketsupemail']=1; // Disable emails sent by ticketsup trigger when creation is done from this page, emails are already sent later
|
||||
|
||||
$id = $object->create($user);
|
||||
if ($id <= 0) {
|
||||
$error++;
|
||||
$errors = ($object->error ? array($object->error) : $object->errors);
|
||||
@ -187,9 +187,20 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
if ($usertoassign > 0) {
|
||||
$object->add_contact($usertoassign, "SUPPORTCLI", 'external', $notrigger = 0);
|
||||
}
|
||||
}
|
||||
|
||||
$object->db->commit();
|
||||
if (! $error)
|
||||
{
|
||||
$object->db->commit();
|
||||
$action = "infos_success";
|
||||
} else {
|
||||
$object->db->rollback();
|
||||
setEventMessage($object->errors, 'errors');
|
||||
$action = 'create_ticket';
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$res = $object->fetch($id);
|
||||
if ($res) {
|
||||
// Create form object
|
||||
@ -208,18 +219,19 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
$mimetype = $attachedfiles['mimes'];
|
||||
|
||||
// Send email to customer
|
||||
|
||||
$subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubject');
|
||||
$message .= ($conf->global->TICKETS_MESSAGE_MAIL_NEW ? $conf->global->TICKETS_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')) . "\n\n";
|
||||
$message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket') . "\n";
|
||||
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $object->track_id;
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id;
|
||||
$infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', '<a href="' . $url_public_ticket . '">' . $object->track_id . '</a>') . "\n";
|
||||
$infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl') . "\n\n";
|
||||
|
||||
$message .= dol_nl2br($infos_new_ticket);
|
||||
$message .= $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE ? $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE : $langs->transnoentities('TicketMessageMailSignatureText');
|
||||
|
||||
$sendto = GETPOST('email');
|
||||
$sendto = GETPOST('email','alpha');
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>';
|
||||
$replyto = $from;
|
||||
@ -241,79 +253,80 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
|
||||
/* Send email to admin */
|
||||
|
||||
// Send email to TICKETS_NOTIFICATION_EMAIL_TO
|
||||
|
||||
$sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO;
|
||||
$subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubjectAdmin');
|
||||
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id) . "\n\n";
|
||||
$message_admin .= '<ul><li>' . $langs->trans('Title') . ' : ' . $object->subject . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Type') . ' : ' . $object->type_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Category') . ' : ' . $object->category_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Severity') . ' : ' . $object->severity_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('From') . ' : ' . $object->origin_email . '</li>';
|
||||
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']))
|
||||
if ($sendto)
|
||||
{
|
||||
foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
|
||||
{
|
||||
$enabled = 1;
|
||||
if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key]))
|
||||
{
|
||||
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
|
||||
}
|
||||
$perms = 1;
|
||||
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key]))
|
||||
{
|
||||
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
|
||||
}
|
||||
$subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubjectAdmin');
|
||||
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id) . "\n\n";
|
||||
$message_admin .= '<ul><li>' . $langs->trans('Title') . ' : ' . $object->subject . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Type') . ' : ' . $object->type_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Category') . ' : ' . $object->category_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Severity') . ' : ' . $object->severity_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('From') . ' : ' . $object->origin_email . '</li>';
|
||||
|
||||
$qualified=true;
|
||||
if (empty($enabled) || $enabled == 2) $qualified = false;
|
||||
if (empty($perms)) $qualified = false;
|
||||
if ($qualified) $message_admin .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
|
||||
}
|
||||
}
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']))
|
||||
{
|
||||
foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
|
||||
{
|
||||
$enabled = 1;
|
||||
if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key]))
|
||||
{
|
||||
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
|
||||
}
|
||||
$perms = 1;
|
||||
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key]))
|
||||
{
|
||||
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
|
||||
}
|
||||
|
||||
$message_admin .= '</ul>';
|
||||
$message_admin .= '<p>' . $langs->trans('Message') . ' : <br>' . $object->message . '</p>';
|
||||
$message_admin .= '<p><a href="' . dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
|
||||
$qualified=true;
|
||||
if (empty($enabled) || $enabled == 2) $qualified = false;
|
||||
if (empty($perms)) $qualified = false;
|
||||
if ($qualified) $message_admin .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>';
|
||||
$replyto = $from;
|
||||
$message_admin .= '</ul>';
|
||||
$message_admin .= '<p>' . $langs->trans('Message') . ' : <br>' . $object->message . '</p>';
|
||||
$message_admin .= '<p><a href="' . dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
|
||||
|
||||
$message_admin = dol_nl2br($message_admin);
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>';
|
||||
$replyto = $from;
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
$message_admin = dol_nl2br($message_admin);
|
||||
|
||||
// Copy files into ticket directory
|
||||
$destdir = $conf->ticketsup->dir_output . '/' . $object->track_id;
|
||||
if (!dol_is_dir($destdir)) {
|
||||
dol_mkdir($destdir);
|
||||
}
|
||||
foreach ($filename as $i => $val) {
|
||||
dol_move($filepath[$i], $destdir . '/' . $filename[$i], 0, 1);
|
||||
$formmail->remove_attached_files($i);
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy files into ticket directory
|
||||
$destdir = $conf->ticketsup->dir_output . '/' . $object->track_id;
|
||||
if (! dol_is_dir($destdir)) {
|
||||
dol_mkdir($destdir);
|
||||
}
|
||||
foreach ($filename as $i => $val) {
|
||||
dol_move($filepath[$i], $destdir . '/' . $filename[$i], 0, 1);
|
||||
$formmail->remove_attached_files($i);
|
||||
}
|
||||
|
||||
setEventMessage($langs->trans('YourTicketSuccessfullySaved'));
|
||||
$action = "infos_success";
|
||||
} else {
|
||||
$object->db->rollback();
|
||||
setEventMessage($object->errors, 'errors');
|
||||
$action = 'create_ticket';
|
||||
}
|
||||
} else {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file ticketsup/public/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
* \file htdocs/public/ticketsup/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file ticketsup/public/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
* \file htdocs/public/ticketsup/list.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
*/
|
||||
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
@ -60,6 +60,13 @@ if (isset($_SESSION['email_customer'])) {
|
||||
|
||||
$object = new ActionsTicketsup($db);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == "view_ticketlist") {
|
||||
$error = 0;
|
||||
$display_ticket_list = false;
|
||||
@ -82,7 +89,8 @@ if ($action == "view_ticketlist") {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$ret = $object->fetch('', $track_id);
|
||||
$ret = $object->fetch('', '', $track_id);
|
||||
|
||||
if ($ret && $object->dao->id > 0) {
|
||||
// vérifie si l'adresse email est bien dans les contacts du ticket
|
||||
$contacts = $object->dao->liste_contact(-1, 'external');
|
||||
@ -118,6 +126,7 @@ if ($action == "view_ticketlist") {
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
$object->doActions($action);
|
||||
|
||||
|
||||
@ -143,11 +152,13 @@ if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) {
|
||||
|
||||
print '<div style="margin: 0 auto; width:60%">';
|
||||
|
||||
if ($action == "view_ticketlist") {
|
||||
if ($action == "view_ticketlist")
|
||||
{
|
||||
|
||||
if ($display_ticket_list) {
|
||||
// Filters
|
||||
$search_fk_status = GETPOST("search_fk_status", 'alpha');
|
||||
$search_subject = GETPOST("search_subject");
|
||||
$search_subject = GETPOST("search_subject", 'alpha');
|
||||
$search_type = GETPOST("search_type", 'alpha');
|
||||
$search_category = GETPOST("search_category", 'alpha');
|
||||
$search_severity = GETPOST("search_severity", 'alpha');
|
||||
@ -155,7 +166,7 @@ if ($action == "view_ticketlist") {
|
||||
$search_fk_user_assign = GETPOST("search_fk_user_assign", 'int');
|
||||
|
||||
// Store current page url
|
||||
$url_page_current = dol_buildpath('/ticketsup/public/list.php', 1);
|
||||
$url_page_current = dol_buildpath('/public/ticketsup/list.php', 1);
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x")) {
|
||||
@ -263,15 +274,13 @@ if ($action == "view_ticketlist") {
|
||||
$limit = $conf->liste_limit;
|
||||
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Request SQL
|
||||
$sql = "SELECT";
|
||||
$sql = "SELECT DISTINCT";
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.ref,";
|
||||
$sql .= " t.track_id,";
|
||||
@ -313,12 +322,12 @@ if ($action == "view_ticketlist") {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "ticketsup_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
}
|
||||
$sql .= " WHERE t.entity IN (" . getEntity('ticketsup') . ")";
|
||||
$sql .= " AND tc.source = 'external'";
|
||||
$sql .= " AND tc.element='" . $object->dao->element . "'";
|
||||
$sql .= " AND tc.active=1";
|
||||
$sql .= " AND (sp.email='" . $db->escape($_SESSION['email_customer']) . "'";
|
||||
$sql .= " AND ((tc.source = 'external'";
|
||||
$sql .= " AND tc.element='" . $db->escape($object->dao->element) . "'";
|
||||
$sql .= " AND tc.active=1)";
|
||||
$sql .= " OR (sp.email='" . $db->escape($_SESSION['email_customer']) . "'";
|
||||
$sql .= " OR s.email='" . $db->escape($_SESSION['email_customer']) . "'";
|
||||
$sql .= " OR t.origin_email='" . $db->escape($_SESSION['email_customer']) . "')";
|
||||
$sql .= " OR t.origin_email='" . $db->escape($_SESSION['email_customer']) . "'))";
|
||||
// Manage filter
|
||||
if (!empty($filter)) {
|
||||
foreach ($filter as $key => $value) {
|
||||
@ -337,7 +346,7 @@ if ($action == "view_ticketlist") {
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql .= " GROUP BY t.track_id";
|
||||
//$sql .= " GROUP BY t.track_id";
|
||||
$sql .= " ORDER BY " . $sortfield . ' ' . $sortorder;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@ -442,9 +451,9 @@ if ($action == "view_ticketlist") {
|
||||
|
||||
// Status
|
||||
if (!empty($arrayfields['t.fk_statut']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="liste_titre">';
|
||||
$selected = ($search_fk_status != "non_closed" ? $search_fk_status : '');
|
||||
$object->printSelectStatus($selected);
|
||||
//$object->printSelectStatus($selected);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -497,16 +506,15 @@ if ($action == "view_ticketlist") {
|
||||
}
|
||||
}
|
||||
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre nowraponall" align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var = true;
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$var = !$var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Date ticket
|
||||
if (!empty($arrayfields['t.datec']['checked'])) {
|
||||
@ -582,11 +590,11 @@ if ($action == "view_ticketlist") {
|
||||
// Message author
|
||||
if (!empty($arrayfields['t.fk_user_create']['checked'])) {
|
||||
print '<td>';
|
||||
if ($obj->fk_user_create) {
|
||||
if ($obj->fk_user_create > 0) {
|
||||
$user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname : '');
|
||||
$user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname : '');
|
||||
$user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create : '');
|
||||
print $user_create->getFullName();
|
||||
print $user_create->getFullName($langs);
|
||||
} else {
|
||||
print $langs->trans('Email');
|
||||
}
|
||||
@ -596,11 +604,11 @@ if ($action == "view_ticketlist") {
|
||||
// Assigned author
|
||||
if (!empty($arrayfields['t.fk_user_assign']['checked'])) {
|
||||
print '<td>';
|
||||
if ($obj->fk_user_assign) {
|
||||
if ($obj->fk_user_assig > 0) {
|
||||
$user_assign->firstname = (!empty($obj->user_assign_firstname) ? $obj->user_assign_firstname : '');
|
||||
$user_assign->lastname = (!empty($obj->user_assign_lastname) ? $obj->user_assign_lastname : '');
|
||||
$user_assign->id = (!empty($obj->fk_user_assign) ? $obj->fk_user_assign : '');
|
||||
print $user_assign->getFullName();
|
||||
print $user_assign->getFullName($langs);
|
||||
} else {
|
||||
print $langs->trans('None');
|
||||
}
|
||||
@ -635,7 +643,7 @@ if ($action == "view_ticketlist") {
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
print '<form method="post" id="form_view_ticket" name="form_view_ticket" enctype="multipart/form-data" action="' . dol_buildpath('/ticketsup/public/view.php', 1) . '" style="display:none;">';
|
||||
print '<form method="post" id="form_view_ticket" name="form_view_ticket" enctype="multipart/form-data" action="' . dol_buildpath('/public/ticketsup/view.php', 1) . '" style="display:none;">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="view_ticket">';
|
||||
print '<input type="hidden" name="btn_view_ticket_list" value="1">';
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file ticketsup/public/index.php
|
||||
* \file htdocs/public/ticketsup/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
*/
|
||||
@ -40,9 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticketsup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticketsup.lib.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$langs->load("companies");
|
||||
$langs->load("other");
|
||||
$langs->load("ticketsup");
|
||||
$langs->loadLangs(array("companies","other","ticketsup"));
|
||||
|
||||
// Get parameters
|
||||
$track_id = GETPOST('track_id', 'alpha');
|
||||
@ -58,6 +56,11 @@ if (isset($_SESSION['email_customer'])) {
|
||||
|
||||
$object = new ActionsTicketsup($db);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == "view_ticket" || $action == "add_message" || $action == "close" || $action == "confirm_public_close" || $action == "new_public_message") {
|
||||
$error = 0;
|
||||
$display_ticket = false;
|
||||
@ -80,7 +83,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$ret = $object->fetch('', $track_id);
|
||||
$ret = $object->fetch('', '', $track_id);
|
||||
if ($ret && $object->dao->id > 0) {
|
||||
// vérifie si l'adresse email est bien dans les contacts du ticket
|
||||
$contacts = $object->dao->liste_contact(-1, 'external');
|
||||
@ -116,16 +119,18 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
||||
}
|
||||
$object->doActions($action);
|
||||
|
||||
/***************************************************
|
||||
* VIEW
|
||||
*
|
||||
****************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formticket = new FormTicketsup($db);
|
||||
|
||||
$arrayofjs = array();
|
||||
$arrayofcss = array('/ticketsup/css/styles.css.php');
|
||||
|
||||
llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||
|
||||
if (!$conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) {
|
||||
@ -151,17 +156,17 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
||||
print '<table class="border" style="width:100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td style="width:40%">' . $langs->trans("Ref") . '</td><td>';
|
||||
print '<tr><td class="titlefield">' . $langs->trans("Ref") . '</td><td>';
|
||||
print $object->dao->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
// Tracking ID
|
||||
print '<tr><td style="width:40%">' . $langs->trans("TicketTrackId") . '</td><td>';
|
||||
print '<tr><td>' . $langs->trans("TicketTrackId") . '</td><td>';
|
||||
print $object->dao->track_id;
|
||||
print '</td></tr>';
|
||||
|
||||
// Subject
|
||||
print '<tr><td><strong>' . $langs->trans("Subject") . '</strong></td><td>';
|
||||
print '<tr><td>' . $langs->trans("Subject") . '</td><td>';
|
||||
print $object->dao->subject;
|
||||
print '</td></tr>';
|
||||
|
||||
@ -218,7 +223,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
||||
}
|
||||
|
||||
// User assigned
|
||||
print '<tr><td>' . $langs->trans("UserAssignedTo") . '</td><td>';
|
||||
print '<tr><td>' . $langs->trans("AssignedTo") . '</td><td>';
|
||||
if ($object->dao->fk_user_assign > 0) {
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($object->dao->fk_user_assign);
|
||||
@ -253,7 +258,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
||||
$formticket->withfile = 2;
|
||||
$formticket->showMessageForm('100%');
|
||||
} else {
|
||||
print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" enctype="multipart/form-data" action="' . dol_buildpath('/ticketsup/public/list.php', 1) . '">';
|
||||
print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" enctype="multipart/form-data" action="' . dol_buildpath('/public/ticketsup/list.php', 1) . '">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="view_ticketlist">';
|
||||
print '<input type="hidden" name="track_id" value="'.$object->dao->track_id.'">';
|
||||
|
||||
@ -134,7 +134,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be inc
|
||||
$userstat = new User($db);
|
||||
$form = new Form($db);
|
||||
$formticket = new FormTicketsup($db);
|
||||
$formproject = new FormProjets($db);
|
||||
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
$formproject = new FormProjets($db);
|
||||
}
|
||||
|
||||
if ($action == 'view' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
||||
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink')
|
||||
@ -631,15 +634,15 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
|
||||
|
||||
print '<div class="tagtd">';
|
||||
|
||||
print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'<br>';
|
||||
print dol_print_phone($tab[$i]['phone'], '', '', '', 'AC_TEL').'<br>';
|
||||
|
||||
if (! empty($tab[$i]['phone_perso'])) {
|
||||
//print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' ';
|
||||
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'<br>';
|
||||
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', 'AC_TEL').'<br>';
|
||||
}
|
||||
if (! empty($tab[$i]['phone_mobile'])) {
|
||||
//print img_picto($langs->trans('PhoneMobile'),'object_phoning.png','',0,0,0).' ';
|
||||
print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', AC_TEL).'<br>';
|
||||
print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', 'AC_TEL').'<br>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -759,7 +759,7 @@ class ActionsTicketsup
|
||||
$url_public_ticket = (!empty($conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) ?
|
||||
(!empty($conf->global->TICKETS_URL_PUBLIC_INTERFACE) ?
|
||||
$conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' :
|
||||
dol_buildpath('/ticketsup/public/view.php', 2)
|
||||
dol_buildpath('/public/ticketsup/view.php', 2)
|
||||
) :
|
||||
dol_buildpath('/ticketsup/card.php', 2)
|
||||
) . '?track_id=' . $object->track_id;
|
||||
@ -928,7 +928,7 @@ class ActionsTicketsup
|
||||
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . "\n" : '');
|
||||
}
|
||||
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $object->track_id;
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id;
|
||||
$message .= "\n\n" . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . $url_public_ticket . "\n";
|
||||
|
||||
// Add signature
|
||||
|
||||
@ -1588,7 +1588,7 @@ class Ticketsup extends CommonObject
|
||||
$url_internal_ticket = dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $this->track_id;
|
||||
$message .= "\n" . $langs->transnoentities('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . '<a href="' . $url_internal_ticket . '">' . $this->track_id . '</a>' . "\n";
|
||||
} else {
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $this->track_id;
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $this->track_id;
|
||||
$message .= "\n" . $langs->transnoentities('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . '<a href="' . $url_public_ticket . '">' . $this->track_id . '</a>' . "\n";
|
||||
}
|
||||
|
||||
@ -1639,7 +1639,7 @@ class Ticketsup extends CommonObject
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if (count($this->cache_logs_ticket)) {
|
||||
if (is_array($this->cache_logs_ticket) && count($this->cache_logs_ticket)) {
|
||||
return 0;
|
||||
}
|
||||
// Cache deja charge
|
||||
@ -1751,7 +1751,7 @@ class Ticketsup extends CommonObject
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if (count($this->cache_msgs_ticket)) {
|
||||
if (is_array($this->cache_msgs_ticket) && count($this->cache_msgs_ticket)) {
|
||||
return 0;
|
||||
}
|
||||
// Cache deja charge
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -580,12 +581,13 @@ print '</tr>'."\n";
|
||||
|
||||
// Detect if we need a fetch on each output line
|
||||
$needToFetchEachLine=0;
|
||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val)
|
||||
{
|
||||
if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object
|
||||
if (! empty($extrafields->attributes[$object->table_element]['computed'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val)
|
||||
{
|
||||
if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
$i=0;
|
||||
|
||||
@ -88,7 +88,7 @@ if ($action == 'create_ticket') {
|
||||
$defaultref = '';
|
||||
}
|
||||
|
||||
$formticket->showForm();
|
||||
$formticket->showForm(1);
|
||||
}
|
||||
|
||||
//$somethingshown=$object->showLinkedObjectBlock();
|
||||
|
||||
@ -234,12 +234,17 @@ class SecurityTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testEncodeDecode()
|
||||
{
|
||||
$stringtotest="This is a string to test encode/decode";
|
||||
$stringtotest="This is a string to test encode/decode. This is a string to test encode/decode. This is a string to test encode/decode.";
|
||||
|
||||
$encodedstring=dol_encode($stringtotest);
|
||||
$decodedstring=dol_decode($encodedstring);
|
||||
print __METHOD__." encodedstring=".$encodedstring." ".base64_encode($stringtotest)."\n";
|
||||
$this->assertEquals($stringtotest,$decodedstring);
|
||||
$this->assertEquals($stringtotest,$decodedstring, 'Use dol_encode/decode with no parameter');
|
||||
|
||||
$encodedstring=dol_encode($stringtotest, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
||||
$decodedstring=dol_decode($encodedstring, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
||||
print __METHOD__." encodedstring=".$encodedstring." ".base64_encode($stringtotest)."\n";
|
||||
$this->assertEquals($stringtotest,$decodedstring, 'Use dol_encode/decode with a key parameter');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user