Merge remote-tracking branch 'Dolibarr/14.0' into 14
This commit is contained in:
commit
0bc258ead2
@ -119,8 +119,8 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
||||
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
|
||||
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinumv3'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinumv5'),
|
||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||
self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'),
|
||||
);
|
||||
@ -516,14 +516,19 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : Quadratus
|
||||
* Export format : Quadratus (Format ASCII)
|
||||
* Format since 2015 compatible QuadraCOMPTA
|
||||
* Last review for this format : 2021/09/13 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html
|
||||
* In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)"
|
||||
*
|
||||
* @param array $TData data
|
||||
* @return void
|
||||
*/
|
||||
public function exportQuadratus(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $db;
|
||||
|
||||
$end_line = "\r\n";
|
||||
|
||||
@ -536,6 +541,44 @@ class AccountancyExport
|
||||
$code_compta = $data->subledger_account;
|
||||
}
|
||||
|
||||
$Tab = array();
|
||||
|
||||
if (!empty($data->subledger_account)) {
|
||||
$Tab['type_ligne'] = 'C';
|
||||
$Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8);
|
||||
$Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30);
|
||||
|
||||
if ($data->doc_type == 'customer_invoice') {
|
||||
$Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc($data->subledger_label, 6), 6));
|
||||
$Tab['filler'] = str_repeat(' ', 52);
|
||||
$Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8);
|
||||
} elseif ($data->doc_type == 'supplier_invoice') {
|
||||
$Tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc($data->subledger_label, 6), 6));
|
||||
$Tab['filler'] = str_repeat(' ', 52);
|
||||
$Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8);
|
||||
} else {
|
||||
$Tab['filler'] = str_repeat(' ', 59);
|
||||
$Tab['coll_compte'] = str_pad(' ', 8);
|
||||
}
|
||||
|
||||
$Tab['filler2'] = str_repeat(' ', 110);
|
||||
$Tab['Maj'] = 2; // Partial update (alpha key, label, address, collectif, RIB)
|
||||
|
||||
if ($data->doc_type == 'customer_invoice') {
|
||||
$Tab['type_compte'] = 'C';
|
||||
} elseif ($data->doc_type == 'supplier_invoice') {
|
||||
$Tab['coll_compte'] = 'F';
|
||||
} else {
|
||||
$Tab['coll_compte'] = 'G';
|
||||
}
|
||||
|
||||
$Tab['filler3'] = str_repeat(' ', 235);
|
||||
|
||||
$Tab['end_line'] = $end_line;
|
||||
|
||||
print implode($Tab);
|
||||
}
|
||||
|
||||
$Tab = array();
|
||||
$Tab['type_ligne'] = 'M';
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 8), 8);
|
||||
|
||||
@ -369,9 +369,9 @@ if ($result) {
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneCustomer").'</span><br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
|
||||
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
|
||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
|
||||
print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
@ -369,9 +369,9 @@ if ($result) {
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneSupplier").'</span><br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
|
||||
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
|
||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
|
||||
print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
@ -1836,7 +1836,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Login Dolibarr
|
||||
// Login Dolibarr - Link to user
|
||||
print '<tr><td>';
|
||||
$editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
|
||||
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
|
||||
|
||||
@ -623,7 +623,7 @@ if ($rowid > 0) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Login Dolibarr
|
||||
// Login Dolibarr - Link to user
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans("LinkedToDolibarrUser");
|
||||
@ -641,7 +641,9 @@ if ($rowid > 0) {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
|
||||
} else {
|
||||
if ($object->user_id) {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
|
||||
$linkeduser = new User($db);
|
||||
$linkeduser->fetch($object->user_id);
|
||||
print $linkeduser->getNomUrl(-1);
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
|
||||
}
|
||||
|
||||
@ -71,6 +71,9 @@ if (empty($action) && empty($id) && empty($ref)) {
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||
if ($object->id > 0) {
|
||||
$object->calculateCosts();
|
||||
}
|
||||
|
||||
// Security check - Protection if external user
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
@ -311,8 +314,6 @@ if (($id || $ref) && $action == 'edit') {
|
||||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = bomPrepareHead($object);
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom');
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ class BOM extends CommonObject
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'),
|
||||
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
|
||||
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'),
|
||||
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'),
|
||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
||||
@ -381,7 +381,7 @@ class BOM extends CommonObject
|
||||
if ($result > 0 && !empty($this->table_element_line)) {
|
||||
$this->fetchLines();
|
||||
}
|
||||
$this->calculateCosts();
|
||||
//$this->calculateCosts(); // This consume a high number of subrequests. Do not call it into fetch but when you need it.
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -1035,7 +1035,8 @@ class BOM extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* BOM costs calculation based on cost_price or pmp of each BOM line
|
||||
* BOM costs calculation based on cost_price or pmp of each BOM line.
|
||||
* Set the property ->total_cost and ->unit_cost of BOM.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -1045,30 +1046,36 @@ class BOM extends CommonObject
|
||||
$this->unit_cost = 0;
|
||||
$this->total_cost = 0;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
|
||||
foreach ($this->lines as &$line) {
|
||||
if (is_array($this->lines) && count($this->lines)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
$tmpproduct = new Product($this->db);
|
||||
$result = $tmpproduct->fetch($line->fk_product);
|
||||
if ($result < 0) {
|
||||
$this->error = $tmpproduct->error;
|
||||
return -1;
|
||||
}
|
||||
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
|
||||
if (empty($line->unit_cost)) {
|
||||
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
|
||||
$line->unit_cost = $productFournisseur->fourn_unitprice;
|
||||
|
||||
foreach ($this->lines as &$line) {
|
||||
$tmpproduct->cost_price = 0;
|
||||
$tmpproduct->pmp = 0;
|
||||
|
||||
$result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading
|
||||
if ($result < 0) {
|
||||
$this->error = $tmpproduct->error;
|
||||
return -1;
|
||||
}
|
||||
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
|
||||
if (empty($line->unit_cost)) {
|
||||
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
|
||||
$line->unit_cost = $productFournisseur->fourn_unitprice;
|
||||
}
|
||||
}
|
||||
|
||||
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
|
||||
|
||||
$this->total_cost += $line->total_cost;
|
||||
}
|
||||
|
||||
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
|
||||
$this->total_cost += $line->total_cost;
|
||||
}
|
||||
|
||||
$this->total_cost = price2num($this->total_cost, 'MT');
|
||||
if ($this->qty) {
|
||||
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
|
||||
$this->total_cost = price2num($this->total_cost, 'MT');
|
||||
if ($this->qty) {
|
||||
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1226,12 +1226,16 @@ if ($action == 'create') {
|
||||
// Object linked
|
||||
if (!empty($origin) && !empty($originid)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
|
||||
print '<td colspan="3">'.dolGetElementUrl($originid, $origin, 1).'</td></tr>';
|
||||
print '<input type="hidden" name="fk_element" value="'.GETPOST('originid', 'int').'">';
|
||||
print '<input type="hidden" name="elementtype" value="'.GETPOST('origin').'">';
|
||||
print '<input type="hidden" name="originid" value="'.GETPOST('originid', 'int').'">';
|
||||
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
|
||||
|
||||
if (! in_array($origin, array('societe', 'project', 'task', 'user'))) {
|
||||
// We do not use link for object that already contains a hard coded
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
|
||||
print '<td colspan="3">'.dolGetElementUrl($originid, $origin, 1).'</td></tr>';
|
||||
print '<input type="hidden" name="fk_element" value="'.GETPOST('originid', 'int').'">';
|
||||
print '<input type="hidden" name="elementtype" value="'.GETPOST('origin').'">';
|
||||
print '<input type="hidden" name="originid" value="'.GETPOST('originid', 'int').'">';
|
||||
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
|
||||
}
|
||||
}
|
||||
|
||||
$reg = array();
|
||||
|
||||
@ -735,13 +735,14 @@ class ActionComm extends CommonObject
|
||||
/**
|
||||
* Load object from database
|
||||
*
|
||||
* @param int $id Id of action to get
|
||||
* @param string $ref Ref of action to get
|
||||
* @param string $ref_ext Ref ext to get
|
||||
* @param string $email_msgid Email msgid
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $id Id of action to get
|
||||
* @param string $ref Ref of action to get
|
||||
* @param string $ref_ext Ref ext to get
|
||||
* @param string $email_msgid Email msgid
|
||||
* @param string $loadresources 1=Load also resources
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '')
|
||||
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '', $loadresources = 1)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -858,7 +859,11 @@ class ActionComm extends CommonObject
|
||||
$this->event_paid = $obj->event_paid;
|
||||
$this->status = $obj->status;
|
||||
|
||||
$this->fetchResources();
|
||||
$this->fetch_optionals();
|
||||
|
||||
if ($loadresources) {
|
||||
$this->fetchResources();
|
||||
}
|
||||
}
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
|
||||
@ -2583,7 +2583,7 @@ if ($action == 'create') {
|
||||
// Create an invoice and classify billed
|
||||
if ($object->statut == Propal::STATUS_SIGNED) {
|
||||
if (!empty($conf->facture->enabled) && $usercancreateinvoice) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
|
||||
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
|
||||
|
||||
@ -2267,7 +2267,6 @@ class Facture extends CommonInvoice
|
||||
$sql .= ' SET fk_facture = NULL, fk_facture_line = NULL';
|
||||
$sql .= ' WHERE fk_facture_line IN ('.$this->db->sanitize(join(',', $list_rowid_det)).')';
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if (!$this->db->query($sql)) {
|
||||
$this->error = $this->db->error()." sql=".$sql;
|
||||
$this->errors[] = $this->error;
|
||||
@ -2276,6 +2275,30 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// Remove other links to the deleted invoice
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'eventorganization_conferenceorboothattendee';
|
||||
$sql .= ' SET fk_invoice = NULL';
|
||||
$sql .= ' WHERE fk_invoice = '.((int) $rowid);
|
||||
|
||||
if (!$this->db->query($sql)) {
|
||||
$this->error = $this->db->error()." sql=".$sql;
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
return -5;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time';
|
||||
$sql .= ' SET invoice_id = NULL, invoice_line_id = NULL';
|
||||
$sql .= ' WHERE invoice_id = '.((int) $rowid);
|
||||
|
||||
if (!$this->db->query($sql)) {
|
||||
$this->error = $this->db->error()." sql=".$sql;
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
return -5;
|
||||
}
|
||||
|
||||
// If we decrease stock on invoice validation, we increase back if a warehouse id was provided
|
||||
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse != -1) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
@ -2299,17 +2322,13 @@ class Facture extends CommonInvoice
|
||||
// Invoice line extrafileds
|
||||
$main = MAIN_DB_PREFIX.'facturedet';
|
||||
$ef = $main."_extrafields";
|
||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM ".$main." WHERE fk_facture = ".((int) $rowid).")";
|
||||
$sqlef = "DELETE FROM ".$ef." WHERE fk_object IN (SELECT rowid FROM ".$main." WHERE fk_facture = ".((int) $rowid).")";
|
||||
// Delete invoice line
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.((int) $rowid);
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
|
||||
if ($this->db->query($sqlef) && $this->db->query($sql) && $this->delete_linked_contact()) {
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.((int) $rowid);
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
// Delete record into ECM index (Note that delete is also done when deleting files with the dol_delete_dir_recursive
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
*
|
||||
@ -31,13 +31,6 @@
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Security check
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'facture', $facid, '');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
@ -60,6 +53,10 @@ $day = GETPOST('day', 'int');
|
||||
$month = GETPOST('month', 'int');
|
||||
$year = GETPOST('year', 'int');
|
||||
|
||||
// Security check
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
$result = restrictedArea($user, 'facture', $facid, '');
|
||||
|
||||
$search_ref = GETPOST("search_ref", "alpha");
|
||||
$search_company = GETPOST("search_company", 'alpha');
|
||||
$search_paymenttype = GETPOST("search_paymenttype");
|
||||
@ -277,6 +274,11 @@ $param .= (GETPOST("orphelins") ? "&orphelins=1" : '');
|
||||
$param .= ($search_ref ? "&search_ref=".urlencode($search_ref) : '');
|
||||
$param .= ($search_company ? "&search_company=".urlencode($search_company) : '');
|
||||
$param .= ($search_amount ? "&search_amount=".urlencode($search_amount) : '');
|
||||
$param .= ($search_paymenttype ? "&search_paymenttype=".urlencode($search_paymenttype) : '');
|
||||
$param .= ($search_account ? "&search_account=".urlencode($search_account) : '');
|
||||
$param .= ($day ? "&day=".urlencode($day) : '');
|
||||
$param .= ($month ? "&month=".urlencode($month) : '');
|
||||
$param .= ($year ? "&year=".urlencode($year) : '');
|
||||
$param .= ($search_payment_num ? "&search_payment_num=".urlencode($search_payment_num) : '');
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
|
||||
@ -1284,7 +1284,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if ($objsoc->id > 0) {
|
||||
$morehtmlref .= $objsoc->getNomUrl(1, 'contact');
|
||||
} else {
|
||||
$morehtmlref .= $langs->trans("ContactNotLinkedToCompany");
|
||||
$morehtmlref .= '<span class="opacitymedium">'.$langs->trans("ContactNotLinkedToCompany").'</span>';
|
||||
}
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
@ -447,6 +447,9 @@ abstract class CommonDocGenerator
|
||||
|
||||
$array_key.'_bank_iban'=>$bank_account->iban,
|
||||
$array_key.'_bank_bic'=>$bank_account->bic,
|
||||
$array_key.'_bank_label'=>$bank_account->label,
|
||||
$array_key.'_bank_number'=>$bank_account->number,
|
||||
$array_key.'_bank_proprio'=>$bank_account->proprio,
|
||||
|
||||
$array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs),
|
||||
$array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
|
||||
|
||||
@ -1263,7 +1263,7 @@ abstract class CommonObject
|
||||
if ($source == 'external' || $source == 'thirdparty') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople t on ec.fk_socpeople = t.rowid";
|
||||
}
|
||||
$sql .= " WHERE ec.element_id =".$this->id;
|
||||
$sql .= " WHERE ec.element_id =".((int) $this->id);
|
||||
$sql .= " AND ec.fk_c_type_contact=tc.rowid";
|
||||
$sql .= " AND tc.element='".$this->db->escape($this->element)."'";
|
||||
if ($code) {
|
||||
@ -1724,6 +1724,18 @@ abstract class CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the project with id $this->fk_project into this->project
|
||||
*
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function fetch_project()
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->fetch_projet();
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the project with id $this->fk_project into this->project
|
||||
@ -7284,7 +7296,11 @@ abstract class CommonObject
|
||||
dol_include_once($InfoFieldList[1]);
|
||||
if ($classname && class_exists($classname)) {
|
||||
$object = new $classname($this->db);
|
||||
$object->fetch($value);
|
||||
if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong
|
||||
$object->fetch($value, '', '', '', 0, 1, 1);
|
||||
} else {
|
||||
$object->fetch($value);
|
||||
}
|
||||
$value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -6769,13 +6769,15 @@ class Form
|
||||
|
||||
// Search data
|
||||
$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX.$objecttmp->table_element." as t";
|
||||
if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
|
||||
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
|
||||
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0];
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (isset($objecttmp->ismultientitymanaged)) {
|
||||
if (!is_numeric($objecttmp->ismultientitymanaged)) {
|
||||
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6786,17 +6788,24 @@ class Form
|
||||
$sql .= $hookmanager->resPrint;
|
||||
} else {
|
||||
$sql .= " WHERE 1=1";
|
||||
if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) {
|
||||
$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
|
||||
}
|
||||
if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
|
||||
$sql .= ' AND parenttable.entity = t.'.$tmparray[0];
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
|
||||
if ($objecttmp->element == 'societe') {
|
||||
$sql .= " AND t.rowid = ".((int) $user->socid);
|
||||
} else {
|
||||
$sql .= " AND t.fk_soc = ".((int) $user->socid);
|
||||
if (isset($objecttmp->ismultientitymanaged)) {
|
||||
if ($objecttmp->ismultientitymanaged == 1) {
|
||||
$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
|
||||
}
|
||||
if (!is_numeric($objecttmp->ismultientitymanaged)) {
|
||||
$sql .= " AND parenttable.entity = t.".$tmparray[0];
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
|
||||
if ($objecttmp->element == 'societe') {
|
||||
$sql .= " AND t.rowid = ".((int) $user->socid);
|
||||
} else {
|
||||
$sql .= " AND t.fk_soc = ".((int) $user->socid);
|
||||
}
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($searchkey != '') {
|
||||
|
||||
@ -73,6 +73,18 @@ class FormAdmin
|
||||
|
||||
$langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 12, 0, $mainlangonly);
|
||||
|
||||
// If the language to select is not inside the list of available language and empty value is not available, we must find
|
||||
// an alternative as the language code to pre-select (to avoid to have first element in list pre-selected).
|
||||
if ($selected && !in_array($selected, $langs_available) && empty($showempty)) {
|
||||
$tmparray = explode('_', $selected);
|
||||
if (!empty($tmparray[1])) {
|
||||
$selected = getLanguageCodeFromCountryCode($tmparray[1]);
|
||||
}
|
||||
if (empty($selected)) {
|
||||
$selected = $langs->defaultlang;
|
||||
}
|
||||
}
|
||||
|
||||
$out = '';
|
||||
|
||||
$out .= '<select '.($multiselect ? 'multiple="multiple" ' : '').'class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiselect ? '[]' : '').'"'.($disabled ? ' disabled' : '').'>';
|
||||
|
||||
@ -486,6 +486,11 @@ class Ldap
|
||||
// For better compatibility with Samba4 AD
|
||||
if ($this->serverType == "activedirectory") {
|
||||
unset($info['cn']); // To avoid error : Operation not allowed on RDN (Code 67)
|
||||
|
||||
// To avoid error : LDAP Error: 53 (Unwilling to perform)
|
||||
if (isset($info['unicodePwd'])) {
|
||||
$info['unicodePwd'] = mb_convert_encoding("\"".$info['unicodePwd']."\"", "UTF-16LE", "UTF-8");
|
||||
}
|
||||
}
|
||||
$result = @ldap_modify($this->connection, $dn, $info);
|
||||
|
||||
|
||||
@ -1128,7 +1128,7 @@ function price2numjs(amount) {
|
||||
var res = Math.round10(amount, - rounding);
|
||||
// Other solution is
|
||||
// var res = dolroundjs(amount, rounding)
|
||||
console.log("res="+res)
|
||||
console.log("price2numjs text="+amount+" return="+res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -8192,8 +8192,8 @@ function picto_from_langcode($codelang, $moreatt = '')
|
||||
* Return default language from country code.
|
||||
* Return null if not found.
|
||||
*
|
||||
* @param string $countrycode Country code like 'US', 'FR', 'CA', 'ES', 'MX', ...
|
||||
* @return string Value of locale like 'en_US', 'fr_FR', ...
|
||||
* @param string $countrycode Country code like 'US', 'FR', 'CA', 'ES', 'IN', 'MX', ...
|
||||
* @return string Value of locale like 'en_US', 'fr_FR', ... or null if not found
|
||||
*/
|
||||
function getLanguageCodeFromCountryCode($countrycode)
|
||||
{
|
||||
@ -8243,12 +8243,12 @@ function getLanguageCodeFromCountryCode($countrycode)
|
||||
'ar-SY',
|
||||
'ar-TN',
|
||||
'ar-YE',
|
||||
'as-IN',
|
||||
//'as-IN', // Moved after en-IN
|
||||
'ba-RU',
|
||||
'be-BY',
|
||||
'bg-BG',
|
||||
'bn-BD',
|
||||
'bn-IN',
|
||||
//'bn-IN', // Moved after en-IN
|
||||
'bo-CN',
|
||||
'br-FR',
|
||||
'ca-ES',
|
||||
@ -8269,6 +8269,8 @@ function getLanguageCodeFromCountryCode($countrycode)
|
||||
'en-GB',
|
||||
'en-IE',
|
||||
'en-IN',
|
||||
'as-IN', // as-IN must be after en-IN (en in priority if country is IN)
|
||||
'bn-IN', // bn-IN must be after en-IN (en in priority if country is IN)
|
||||
'en-JM',
|
||||
'en-MY',
|
||||
'en-NZ',
|
||||
@ -8406,7 +8408,7 @@ function getLanguageCodeFromCountryCode($countrycode)
|
||||
$locale_language = locale_get_primary_language($locale);
|
||||
$locale_region = locale_get_region($locale);
|
||||
if (strtoupper($countrycode) == $locale_region) {
|
||||
//var_dump($locale.'-'.$locale_language.'-'.$locale_region);
|
||||
//var_dump($locale.' - '.$locale_language.' - '.$locale_region);
|
||||
return strtolower($locale_language).'_'.strtoupper($locale_region);
|
||||
}
|
||||
}
|
||||
@ -8846,7 +8848,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
||||
if ($newcrit != '') {
|
||||
$numnewcrit = price2num($newcrit);
|
||||
if (is_numeric($numnewcrit)) {
|
||||
$newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.$db->sanitize($numnewcrit); // should be a numeric
|
||||
$newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.((float) $numnewcrit); // should be a numeric
|
||||
} else {
|
||||
$newres .= ($i2 > 0 ? ' OR ' : '').'1 = 2'; // force false
|
||||
}
|
||||
@ -8905,7 +8907,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
||||
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '');
|
||||
|
||||
if (preg_match('/\.(id|rowid)$/', $field)) { // Special case for rowid that is sometimes a ref so used as a search field
|
||||
$newres .= $field." = ".(is_numeric(trim($tmpcrit)) ?trim($tmpcrit) : '0');
|
||||
$newres .= $field." = ".(is_numeric(trim($tmpcrit)) ? ((float) trim($tmpcrit)) : '0');
|
||||
} else {
|
||||
$newres .= $field." LIKE '";
|
||||
|
||||
|
||||
@ -513,8 +513,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
if (!$user->rights->salaries->delete) {
|
||||
$deleteok = 0;
|
||||
}
|
||||
} elseif ($feature == 'salaries') {
|
||||
if (!$user->rights->salaries->delete) {
|
||||
} elseif ($feature == 'adherent') {
|
||||
if (!$user->rights->adherent->supprimer) {
|
||||
$deleteok = 0;
|
||||
}
|
||||
} elseif (!empty($feature2)) { // This is for permissions on 2 levels
|
||||
|
||||
@ -106,8 +106,8 @@ class ConferenceOrBooth extends ActionComm
|
||||
'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
|
||||
'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project'),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
|
||||
'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1),
|
||||
'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'),
|
||||
'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',),
|
||||
|
||||
@ -103,14 +103,15 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
public $fields=array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'),
|
||||
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project'),
|
||||
'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,),
|
||||
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
|
||||
'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1,),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
|
||||
'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
|
||||
'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'),
|
||||
'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,),
|
||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,),
|
||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>3,),
|
||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
|
||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>-1, 'visible'=>-2),
|
||||
@ -126,6 +127,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
public $fk_actioncomm;
|
||||
public $email;
|
||||
public $date_subscription;
|
||||
public $fk_invoice;
|
||||
public $amount;
|
||||
public $note_public;
|
||||
public $note_private;
|
||||
@ -634,6 +636,31 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the project with id $this->fk_project into this->project
|
||||
*
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function fetch_projet()
|
||||
{
|
||||
// phpcs:enable
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
if (empty($this->fk_project) && !empty($this->fk_projet)) {
|
||||
$this->fk_project = $this->fk_projet; // For backward compatibility
|
||||
}
|
||||
if (empty($this->fk_project)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$project = new Project($this->db);
|
||||
$result = $project->fetch($this->fk_project);
|
||||
|
||||
$this->projet = $project; // deprecated
|
||||
$this->project = $project;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set draft status
|
||||
@ -836,6 +863,17 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the label of the status
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function getLabelStatus($mode = 0)
|
||||
{
|
||||
return $this->LibStatut($this->status, $mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the label of the status
|
||||
*
|
||||
|
||||
@ -152,8 +152,6 @@ if (empty($reshook)) {
|
||||
|
||||
/*
|
||||
* View
|
||||
*
|
||||
* Put here all code to build page
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@ -55,6 +55,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ''
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$projectid = GETPOST('projectid', 'int');
|
||||
$projectref = GETPOST('ref');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
@ -152,12 +153,12 @@ if (!$permissiontoread) accessforbidden();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (preg_match('/^set/', $action) && $projectid > 0 && !empty($user->rights->eventorganization->write)) {
|
||||
if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && !empty($user->rights->eventorganization->write)) {
|
||||
$project = new Project($db);
|
||||
//If "set" fields keys is in projects fields
|
||||
$project_attr=preg_replace('/^set/', '', $action);
|
||||
if (array_key_exists($project_attr, $project->fields)) {
|
||||
$result = $project->fetch($projectid);
|
||||
$result = $project->fetch($projectid, $projectref);
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $project->errors, 'errors');
|
||||
} else {
|
||||
@ -234,11 +235,13 @@ $now = dol_now();
|
||||
$help_url = '';
|
||||
$title = $langs->trans('ListOfConferencesOrBooths');
|
||||
|
||||
if ($projectid > 0) {
|
||||
if ($projectid > 0 || $projectref) {
|
||||
$project = new Project($db);
|
||||
$result = $project->fetch($projectid);
|
||||
$result = $project->fetch($projectid, $projectref);
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $project->errors, 'errors');
|
||||
} else {
|
||||
$projectid = $project->id;
|
||||
}
|
||||
$result = $project->fetch_thirdparty();
|
||||
if ($result < 0) {
|
||||
@ -430,8 +433,8 @@ if ($projectid > 0) {
|
||||
print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage"));
|
||||
//print '</span>';
|
||||
print '</td><td>';
|
||||
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id;
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5');
|
||||
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $project->id);
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5');
|
||||
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
|
||||
//print '<div class="urllink">';
|
||||
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
|
||||
@ -447,8 +450,8 @@ if ($projectid > 0) {
|
||||
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
|
||||
//print '</span>';
|
||||
print '</td><td>';
|
||||
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$project->id.'&type=global';
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5');
|
||||
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.((int) $project->id).'&type=global';
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5');
|
||||
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
|
||||
//print '<div class="urllink">';
|
||||
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
|
||||
@ -582,7 +585,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
|
||||
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".dol_buildpath('/eventorganization/conferenceorbooth_card.php', 1).'?id='.$id);
|
||||
header("Location: ".DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?id='.((int) $id));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
|
||||
$conf_or_booth_id = GETPOST('conforboothid', 'int');
|
||||
$fk_project = GETPOST('fk_project', 'int');
|
||||
$withproject = GETPOST('withproject', 'int');
|
||||
$withproject = 1;
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new ConferenceOrBoothAttendee($db);
|
||||
@ -65,6 +65,7 @@ if ($conf_or_booth_id > 0) {
|
||||
} else {
|
||||
$object->fk_actioncomm = $confOrBooth->id;
|
||||
$object->fk_project = $confOrBooth->fk_project;
|
||||
$fk_project = $object->fk_project;
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,12 +75,24 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = GETPOST("search_all", 'alpha');
|
||||
$search_all = GETPOST('search_all', 'alphanohtml');
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha')) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
|
||||
$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
|
||||
}
|
||||
}
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (!empty($val['searchall'])) {
|
||||
$fieldstosearchall['t.'.$key] = $val['label'];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($action) && empty($id) && empty($ref)) {
|
||||
@ -174,8 +187,6 @@ if (empty($reshook)) {
|
||||
|
||||
/*
|
||||
* View
|
||||
*
|
||||
* Put here all code to build page
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
@ -305,7 +316,7 @@ if (!empty($withproject)) {
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
@ -319,7 +330,7 @@ if (!empty($withproject)) {
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '<tr><td>';
|
||||
print '<tr><td class="nowrap">';
|
||||
$typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
@ -336,15 +347,15 @@ if (!empty($withproject)) {
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
@ -353,7 +364,7 @@ if (!empty($withproject)) {
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|
||||
|
||||
// Show message
|
||||
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
||||
$message = '<a target="_blank" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
||||
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
|
||||
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
|
||||
print $message;
|
||||
@ -366,7 +377,7 @@ if (!empty($withproject)) {
|
||||
//print '</span>';
|
||||
print '</td><td>';
|
||||
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
|
||||
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
|
||||
//print '<div class="urllink">';
|
||||
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
|
||||
@ -383,7 +394,7 @@ if (!empty($withproject)) {
|
||||
//print '</span>';
|
||||
print '</td><td>';
|
||||
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$projectstatic->id.'&type=global';
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
|
||||
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
|
||||
//print '<div class="urllink">';
|
||||
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
|
||||
@ -565,6 +576,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
$keyforbreak = 'note_public';
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ if (!$sortorder) {
|
||||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
|
||||
$search_all = GETPOST('search_all', 'alphanohtml');
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
@ -369,8 +369,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
}
|
||||
|
||||
|
||||
// Output page
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
|
||||
|
||||
@ -646,22 +644,25 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
if ($confOrBooth->id > 0) {
|
||||
$param .= '&conforboothid='.urlencode($confOrBooth->id).$withProjectUrl;
|
||||
$param .= '&conforboothid='.urlencode($confOrBooth->id);
|
||||
}
|
||||
if ($projectstatic->id > 0) {
|
||||
$param .= '&fk_project='.urlencode($projectstatic->id).$withProjectUrl;
|
||||
$param .= '&fk_project='.urlencode($projectstatic->id);
|
||||
}
|
||||
|
||||
$param .= $withProjectUrl;
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
@ -694,6 +695,8 @@ print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
||||
print '<input type="hidden" name="fk_project" value="'.$fk_project.'">';
|
||||
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd);
|
||||
|
||||
|
||||
@ -2553,7 +2553,7 @@ if ($action == 'create') {
|
||||
// Presend form
|
||||
$modelmail = 'shipping_send';
|
||||
$defaulttopic = 'SendShippingRef';
|
||||
$diroutput = $conf->expedition->dir_output.'/sending';
|
||||
$diroutput = $conf->expedition->dir_output;
|
||||
$trackid = 'shi'.$object->id;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
|
||||
@ -1459,8 +1459,8 @@ class Expedition extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// delete batch expedition line
|
||||
if (!$error && $conf->productbatch->enabled) {
|
||||
// delete batch expedition line (we try deletion even if module not enabled in case of the module were enabled and disabled previously)
|
||||
if (!$error) {
|
||||
if (ExpeditionLineBatch::deletefromexp($this->db, $this->id) < 0) {
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
@ -402,16 +402,16 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
if ($sall) {
|
||||
$param .= "&sall=".urlencode($sall);
|
||||
$param .= "&sall=".urlencode($sall);
|
||||
}
|
||||
if ($search_ref_exp) {
|
||||
$param .= "&search_ref_exp=".urlencode($search_ref_exp);
|
||||
$param .= "&search_ref_exp=".urlencode($search_ref_exp);
|
||||
}
|
||||
if ($search_ref_liv) {
|
||||
$param .= "&search_ref_liv=".urlencode($search_ref_liv);
|
||||
$param .= "&search_ref_liv=".urlencode($search_ref_liv);
|
||||
}
|
||||
if ($search_ref_customer) {
|
||||
$param .= "&search_ref_customer=".urlencode($search_ref_customer);
|
||||
$param .= "&search_ref_customer=".urlencode($search_ref_customer);
|
||||
}
|
||||
if ($search_user > 0) {
|
||||
$param .= '&search_user='.urlencode($search_user);
|
||||
@ -420,10 +420,10 @@ if ($search_sale > 0) {
|
||||
$param .= '&search_sale='.urlencode($search_sale);
|
||||
}
|
||||
if ($search_company) {
|
||||
$param .= "&search_company=".urlencode($search_company);
|
||||
$param .= "&search_company=".urlencode($search_company);
|
||||
}
|
||||
if ($search_tracking) {
|
||||
$param .= "&search_tracking=".urlencode($search_tracking);
|
||||
$param .= "&search_tracking=".urlencode($search_tracking);
|
||||
}
|
||||
if ($search_town) {
|
||||
$param .= '&search_town='.urlencode($search_town);
|
||||
@ -768,7 +768,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Ref
|
||||
if (!empty($arrayfields['e.ref']['checked'])) {
|
||||
print "<td>";
|
||||
print '<td class="nowraponall">';
|
||||
print $shipment->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
@ -788,7 +788,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Third party
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $companystatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -806,7 +806,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Zip
|
||||
if (!empty($arrayfields['s.zip']['checked'])) {
|
||||
print '<td class="nocellnopadd">';
|
||||
print '<td class="nocellnopadd center">';
|
||||
print $obj->zip;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -815,7 +815,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// State
|
||||
if (!empty($arrayfields['state.nom']['checked'])) {
|
||||
print "<td>".$obj->state_name."</td>\n";
|
||||
print '<td class="center">'.$obj->state_name."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -2440,7 +2440,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
if ($facturestatic->hasDelay()) {
|
||||
$response->nbtodolate++;
|
||||
$response->url_late = DOL_URL_ROOT.'/fourn/facture/list.php?option=late&mainmenu=billing&leftmenu=suppliers_bills';
|
||||
$response->url_late = DOL_URL_ROOT.'/fourn/facture/list.php?search_option=late&mainmenu=billing&leftmenu=suppliers_bills';
|
||||
}
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -680,6 +680,7 @@ if (empty($reshook)) {
|
||||
if ($socid > 0) {
|
||||
$object->socid = GETPOST('socid', 'int');
|
||||
}
|
||||
$selectedLines = GETPOST('toselect', 'array');
|
||||
|
||||
$db->begin();
|
||||
|
||||
@ -1112,6 +1113,10 @@ if (empty($reshook)) {
|
||||
|
||||
$num = count($lines);
|
||||
for ($i = 0; $i < $num; $i++) { // TODO handle subprice < 0
|
||||
if (!in_array($lines[$i]->id, $selectedLines)) {
|
||||
continue; // Skip unselected lines
|
||||
}
|
||||
|
||||
$desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle);
|
||||
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
|
||||
|
||||
@ -2348,9 +2353,6 @@ if ($action == 'create') {
|
||||
print '<input type="button" class="button button-cancel" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
// Show origin lines
|
||||
if (is_object($objectsrc)) {
|
||||
print '<br>';
|
||||
@ -2364,6 +2366,8 @@ if ($action == 'create') {
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
print "</form>\n";
|
||||
} else {
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
//
|
||||
|
||||
@ -119,7 +119,7 @@ $search_btn = GETPOST('button_search', 'alpha');
|
||||
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
||||
$search_categ_sup = trim(GETPOST("search_categ_sup", 'int'));
|
||||
|
||||
$option = GETPOST('option');
|
||||
$option = GETPOST('search_option');
|
||||
if ($option == 'late') {
|
||||
$search_status = '1';
|
||||
}
|
||||
@ -803,7 +803,7 @@ if ($resql) {
|
||||
$param .= '&show_files='.urlencode($show_files);
|
||||
}
|
||||
if ($option) {
|
||||
$param .= "&option=".urlencode($option);
|
||||
$param .= "&search_option=".urlencode($option);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
@ -1428,9 +1428,9 @@ if ($resql) {
|
||||
|
||||
// Date limit
|
||||
if (!empty($arrayfields['f.date_lim_reglement']['checked'])) {
|
||||
print '<td class="center nowrap">'.dol_print_date($datelimit, 'day');
|
||||
print '<td class="center nowraponall">'.dol_print_date($datelimit, 'day');
|
||||
if ($facturestatic->hasDelay()) {
|
||||
print img_warning($langs->trans('Late'));
|
||||
print img_warning($langs->trans('Alert').' - '.$langs->trans('Late'));
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
||||
@ -47,6 +47,9 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 've
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
// Security check
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_day = GETPOST('search_day', 'int');
|
||||
$search_month = GETPOST('search_month', 'int');
|
||||
|
||||
@ -627,6 +627,12 @@ if ($resql) {
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// End date
|
||||
if (!empty($arrayfields['cp.date_valid']['checked'])) {
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
// Fields from hook
|
||||
@ -687,6 +693,9 @@ if ($resql) {
|
||||
if (!empty($arrayfields['cp.date_fin']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], "cp.date_fin", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['cp.date_valid']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['cp.date_valid']['label'], $_SERVER["PHP_SELF"], "cp.date_valid", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
@ -816,6 +825,18 @@ if ($resql) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.date_valid']['checked'])) { // date_valid is both date_valid but also date_approval
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_valid), 'day');
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
/*if (!empty($arrayfields['cp.date_approve']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_approve), 'day');
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}*/
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
|
||||
@ -35,12 +35,13 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,<br><br>\n\n__(YourCandidatureAnswerMessage)__<br>__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 0);
|
||||
|
||||
-- Event organization
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__(Sincerely)__<br /><br />__MYCOMPANY_NAME__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,<br /><br />__(OrganizationEventConfRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,<br /><br />__(OrganizationEventBoothRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
-- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfBoothWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfRegistrationWasReceived)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
|
||||
-- Partnership
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipWillSoonBeCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipWillSoonBeCanceledTopic)__', 0, '<body>\n <p>__(Hello)__,<br><br>\n__(YourPartnershipWillSoonBeCanceledContent)__</p>\n<br />\n\n<br />\n\n __(Sincerely)__ <br />\n __[MAIN_INFO_SOCIETE_NOM]__ <br />\n </body>\n');
|
||||
|
||||
@ -268,12 +268,13 @@ ALTER TABLE llx_tva ALTER COLUMN paye SET DEFAULT 0;
|
||||
|
||||
|
||||
-- Event organization
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__(Sincerely)__<br /><br />__MYCOMPANY_NAME__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,<br /><br />__(OrganizationEventConfRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,<br /><br />__(OrganizationEventBoothRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
-- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfBoothWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfRegistrationWasReceived)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
|
||||
ALTER TABLE llx_projet ADD COLUMN accept_conference_suggestions integer DEFAULT 0;
|
||||
ALTER TABLE llx_projet ADD COLUMN accept_booth_suggestions integer DEFAULT 0;
|
||||
@ -402,6 +403,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee(
|
||||
fk_soc integer,
|
||||
fk_actioncomm integer,
|
||||
fk_project integer NOT NULL,
|
||||
fk_invoice integer NULL,
|
||||
email varchar(100),
|
||||
date_subscription datetime,
|
||||
amount double DEFAULT NULL,
|
||||
@ -421,6 +423,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee(
|
||||
-- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_actioncomm DROP NOT NULL;
|
||||
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_project integer NOT NULL;
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_invoice integer NULL;
|
||||
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_rowid (rowid);
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_ref (ref);
|
||||
|
||||
@ -21,6 +21,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee(
|
||||
fk_soc integer,
|
||||
fk_actioncomm integer,
|
||||
fk_project integer NOT NULL,
|
||||
fk_invoice integer NULL,
|
||||
email varchar(100),
|
||||
date_subscription datetime,
|
||||
amount double DEFAULT NULL,
|
||||
|
||||
@ -343,7 +343,7 @@ Modelcsv_ciel=Export for Sage50, Ciel Compta or Compta Evo. (Format XIMPORT)
|
||||
Modelcsv_quadratus=Export for Quadratus QuadraCompta
|
||||
Modelcsv_ebp=Export for EBP
|
||||
Modelcsv_cogilog=Export for Cogilog
|
||||
Modelcsv_agiris=Export for Agiris
|
||||
Modelcsv_agiris=Export for Agiris Isacompta
|
||||
Modelcsv_LDCompta=Export for LD Compta (v9) (Test)
|
||||
Modelcsv_LDCompta10=Export for LD Compta (v10 & higher)
|
||||
Modelcsv_openconcerto=Export for OpenConcerto (Test)
|
||||
@ -351,9 +351,10 @@ Modelcsv_configurable=Export CSV Configurable
|
||||
Modelcsv_FEC=Export FEC
|
||||
Modelcsv_FEC2=Export FEC (With dates generation writing / document reversed)
|
||||
Modelcsv_Sage50_Swiss=Export for Sage 50 Switzerland
|
||||
Modelcsv_winfic=Export Winfic - eWinfic - WinSis Compta
|
||||
Modelcsv_winfic=Export for Winfic - eWinfic - WinSis Compta
|
||||
Modelcsv_Gestinumv3=Export for Gestinum (v3)
|
||||
Modelcsv_Gestinumv5Export for Gestinum (v5)
|
||||
Modelcsv_Gestinumv5=Export for Gestinum (v5)
|
||||
Modelcsv_charlemagne=Export for Aplim Charlemagne
|
||||
ChartofaccountsId=Chart of accounts Id
|
||||
|
||||
## Tools - Init accounting account on product / service
|
||||
|
||||
@ -896,6 +896,11 @@ Permission1002=Create/modify warehouses
|
||||
Permission1003=Delete warehouses
|
||||
Permission1004=Read stock movements
|
||||
Permission1005=Create/modify stock movements
|
||||
Permission1011=View inventories
|
||||
Permission1012=Create new inventory
|
||||
Permission1014=Validate inventory
|
||||
Permission1015=Allow to change PMP value for a product
|
||||
Permission1016=Delete inventory
|
||||
Permission1101=Read delivery receipts
|
||||
Permission1102=Create/modify delivery receipts
|
||||
Permission1104=Validate delivery receipts
|
||||
|
||||
@ -67,8 +67,8 @@ YourOrganizationEventConfRequestWasReceived = Your request for conference was re
|
||||
YourOrganizationEventBoothRequestWasReceived = Your request for booth was received
|
||||
EventOrganizationEmailAskConf = Request for conference
|
||||
EventOrganizationEmailAskBooth = Request for booth
|
||||
EventOrganizationEmailSubsBooth = Subscription for booth
|
||||
EventOrganizationEmailSubsEvent = Subscription for an event
|
||||
EventOrganizationEmailBoothPayment = Payment of your booth
|
||||
EventOrganizationEmailRegistrationPayment = Registration for an event
|
||||
EventOrganizationMassEmailAttendees = Communication to attendees
|
||||
EventOrganizationMassEmailSpeakers = Communication to speakers
|
||||
|
||||
@ -130,6 +130,12 @@ DateMustBeBeforeThan=%s must be before %s
|
||||
DateMustBeAfterThan=%s must be after %s
|
||||
|
||||
NewSubscription=Registration
|
||||
OrganizationEventConfRequestWasReceived=Your suggestion for a conference has been received
|
||||
OrganizationEventBoothRequestWasReceived=Your request for a booth has been received
|
||||
OrganizationEventPaymentOfBoothWasReceived=Your payment for your booth has been recorded
|
||||
OrganizationEventPaymentOfRegistrationWasReceived=Your payment for your event registration has been recorded
|
||||
OrganizationEventBulkMailToAttendees=This is a remind about your participation in the event as an attendee
|
||||
OrganizationEventBulkMailToSpeakers=This is a reminder on your participation in the event as a speaker
|
||||
|
||||
#
|
||||
# Vote page
|
||||
@ -149,3 +155,7 @@ PaymentConferenceAttendee = Conference attendee payment
|
||||
PaymentBoothLocation = Booth location payment
|
||||
|
||||
RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email <b>%s</b>
|
||||
EmailAttendee=Attendee email
|
||||
EmailCompanyForInvoice=Company email (for invoice, if different of attendee email)
|
||||
ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation
|
||||
ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation
|
||||
@ -6,6 +6,7 @@ Language_ar_MA=Arabic (Moroco)
|
||||
Language_ar_SA=Arabic
|
||||
Language_ar_TN=Arabic (Tunisia)
|
||||
Language_ar_IQ=Arabic (Iraq)
|
||||
Language_as_IN=Assamese
|
||||
Language_az_AZ=Azerbaijani
|
||||
Language_bn_BD=Bengali
|
||||
Language_bn_IN=Bengali (India)
|
||||
|
||||
@ -1039,6 +1039,18 @@ if (!defined('NOLOGIN')) {
|
||||
$user->rights->user->user->supprimer = 1;
|
||||
$user->rights->user->self->creer = 1;
|
||||
$user->rights->user->self->password = 1;
|
||||
|
||||
//Required if advanced permissions are used with MAIN_USE_ADVANCED_PERMS
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$user->rights->user->user_advance->readperms = 1;
|
||||
$user->rights->user->user_advance->write = 1;
|
||||
$user->rights->user->self_advance->readperms = 1;
|
||||
$user->rights->user->self_advance->writeperms = 1;
|
||||
$user->rights->user->group_advance->read = 1;
|
||||
$user->rights->user->group_advance->readperms = 1;
|
||||
$user->rights->user->group_advance->write = 1;
|
||||
$user->rights->user->group_advance->delete = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -845,6 +845,17 @@ class MyObject extends CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the label of the status
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function getLabelStatus($mode = 0)
|
||||
{
|
||||
return $this->LibStatut($this->status, $mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the label of the status
|
||||
*
|
||||
|
||||
@ -134,7 +134,7 @@ if (!$sortorder) {
|
||||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
|
||||
$search_all = GETPOST('search_all', 'alphanohtml');
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
@ -414,9 +414,11 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ if (!$sortorder) {
|
||||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
|
||||
$search_all = GETPOST('search_all', 'alphanohtml');
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
@ -270,8 +270,7 @@ $sql .= $hookmanager->resPrint;
|
||||
|
||||
/* If a group by is required
|
||||
$sql.= " GROUP BY ";
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
foreach($object->fields as $key => $val) {
|
||||
$sql.='t.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
@ -343,9 +342,11 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,6 +121,7 @@ class Partnership extends CommonObject
|
||||
'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>63, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',),
|
||||
'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>-2,),
|
||||
'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>64, 'notnull'=>0, 'visible'=>-2,),
|
||||
// fk_member and fk_soc are added into constructor
|
||||
);
|
||||
|
||||
/**
|
||||
@ -197,9 +198,9 @@ class Partnership extends CommonObject
|
||||
$this->db = $db;
|
||||
|
||||
if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') {
|
||||
$this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member');
|
||||
$this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member', 'csslist'=>'tdoverflowmax150');
|
||||
} else {
|
||||
$this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company');
|
||||
$this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company', 'csslist'=>'tdoverflowmax150');
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
|
||||
|
||||
@ -1008,7 +1008,6 @@ class Product extends CommonObject
|
||||
$this->accountancy_code_sell_export = trim($this->accountancy_code_sell_export);
|
||||
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$result = 0;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -54,7 +54,9 @@ $cancel = GETPOST('cancel', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'pricesuppliercard';
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$cost_price = GETPOST('cost_price', 'alpha');
|
||||
$cost_price = price2num(GETPOST('cost_price', 'alpha'), '', 2);
|
||||
$pmp = price2num(GETPOST('pmp', 'alpha'), '', 2);
|
||||
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$error = 0;
|
||||
|
||||
@ -147,13 +149,29 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($action == 'setpmp') {
|
||||
if ($id) {
|
||||
$result = $object->fetch($id);
|
||||
$object->pmp = price2num($pmp);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".((float) $object->pmp)." WHERE rowid = ".((int) $id);
|
||||
$resql = $db->query($sql);
|
||||
//$result = $object->update($object->id, $user);
|
||||
if ($resql) {
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
$action = '';
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'confirm_remove_pf') {
|
||||
if ($rowid) { // id of product supplier price to remove
|
||||
$action = '';
|
||||
$result = $object->remove_product_fournisseur_price($rowid);
|
||||
if ($result > 0) {
|
||||
$db->query("DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = $rowid");
|
||||
$db->query("DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = ".((int) $rowid));
|
||||
setEventMessages($langs->trans("PriceRemoved"), null, 'mesgs');
|
||||
} else {
|
||||
$error++;
|
||||
@ -425,11 +443,25 @@ if ($id > 0 || $ref) {
|
||||
print '</td></tr>';
|
||||
|
||||
// PMP
|
||||
print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).'</td>';
|
||||
$usercaneditpmp = 0;
|
||||
if (!empty($conf->global->PRODUCT_CAN_EDIT_WAP)) {
|
||||
$usercaneditpmp = $usercancreate;
|
||||
}
|
||||
print '<tr><td class="titlefieldcreate">';
|
||||
$textdesc = $langs->trans("AverageUnitPricePMPDesc");
|
||||
$text = $form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $textdesc, 1, 'help', '');
|
||||
print $form->editfieldkey($text, 'pmp', $object->pmp, $object, $usercaneditpmp, 'amount:6');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($text, 'pmp', ($object->pmp > 0 ? $object->pmp : ''), $object, $usercaneditpmp, 'amount:6');
|
||||
if ($object->pmp > 0) {
|
||||
print ' '.$langs->trans("HT");
|
||||
}
|
||||
/*
|
||||
.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).'</td>';
|
||||
print '<td>';
|
||||
if ($object->pmp > 0) {
|
||||
print price($object->pmp).' '.$langs->trans("HT");
|
||||
}
|
||||
}*/
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -623,7 +655,7 @@ if ($id > 0 || $ref) {
|
||||
// Currency
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||
print '<td>';
|
||||
$currencycodetouse = GETPOST('multicurrency_code') ?GETPOST('multicurrency_code') : (isset($object->fourn_multicurrency_code) ? $object->fourn_multicurrency_code : '');
|
||||
$currencycodetouse = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : (isset($object->fourn_multicurrency_code) ? $object->fourn_multicurrency_code : '');
|
||||
if (empty($currencycodetouse) && $object->fourn_multicurrency_tx == 1) {
|
||||
$currencycodetouse = $conf->currency;
|
||||
}
|
||||
@ -635,7 +667,7 @@ if ($id > 0 || $ref) {
|
||||
|
||||
// Currency price qty min
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PriceQtyMinCurrency").'</td>';
|
||||
$pricesupplierincurrencytouse = (GETPOST('multicurrency_price') ?GETPOST('multicurrency_price') : (isset($object->fourn_multicurrency_price) ? $object->fourn_multicurrency_price : ''));
|
||||
$pricesupplierincurrencytouse = (GETPOST('multicurrency_price') ? GETPOST('multicurrency_price') : (isset($object->fourn_multicurrency_price) ? $object->fourn_multicurrency_price : ''));
|
||||
print '<td><input class="flat" name="multicurrency_price" size="8" value="'.price($pricesupplierincurrencytouse).'">';
|
||||
print ' ';
|
||||
print $form->selectPriceBaseType((GETPOST('multicurrency_price_base_type') ?GETPOST('multicurrency_price_base_type') : 'HT'), "multicurrency_price_base_type"); // We keep 'HT' here, multicurrency_price_base_type is not yet supported for supplier prices
|
||||
@ -651,43 +683,45 @@ if ($id > 0 || $ref) {
|
||||
print '</td></tr>';
|
||||
|
||||
$currencies = array();
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE entity = '.$conf->entity;
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE entity = '.((int) $conf->entity);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$currency = new MultiCurrency($db);
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$currency->fetch($obj->rowid);
|
||||
$currencies[$currency->code] = $currency->rate->rate;
|
||||
$currencies[$currency->code] = ((float) $currency->rate->rate);
|
||||
}
|
||||
}
|
||||
$currencies = json_encode($currencies);
|
||||
|
||||
print <<<END
|
||||
<!-- javascript to autocalculate the minimum price -->
|
||||
<script type="text/javascript">
|
||||
function update_price_from_multicurrency() {
|
||||
var multicurrency_price = $('input[name="multicurrency_price"]').val();
|
||||
var multicurrency_tx = $('input[name="multicurrency_tx"]').val();
|
||||
$('input[name="price"]').val(multicurrency_price / multicurrency_tx);
|
||||
$('input[name="disabled_price"]').val(multicurrency_price / multicurrency_tx);
|
||||
console.log("update_price_from_multicurrency");
|
||||
var multicurrency_price = price2numjs($('input[name="multicurrency_price"]').val());
|
||||
var multicurrency_tx = price2numjs($('input[name="multicurrency_tx"]').val());
|
||||
if (multicurrency_tx != 0) {
|
||||
$('input[name="price"]').val(multicurrency_price / multicurrency_tx);
|
||||
$('input[name="disabled_price"]').val(multicurrency_price / multicurrency_tx);
|
||||
} else {
|
||||
$('input[name="price"]').val('');
|
||||
$('input[name="disabled_price"]').val('');
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
$('input[name="disabled_price"]').prop('disabled', true);
|
||||
$('select[name="disabled_price_base_type"]').prop('disabled', true);
|
||||
update_price_from_multicurrency();
|
||||
|
||||
$('input[name="multicurrency_price"]').keyup(function () {
|
||||
update_price_from_multicurrency();
|
||||
}).change(function () {
|
||||
update_price_from_multicurrency();
|
||||
}).on('paste', function () {
|
||||
$('input[name="multicurrency_price"], input[name="multicurrency_tx"]').keyup(function () {
|
||||
update_price_from_multicurrency();
|
||||
});
|
||||
|
||||
$('input[name="multicurrency_tx"]').keyup(function () {
|
||||
$('input[name="multicurrency_price"], input[name="multicurrency_tx"]').change(function () {
|
||||
update_price_from_multicurrency();
|
||||
}).change(function () {
|
||||
update_price_from_multicurrency();
|
||||
}).on('paste', function () {
|
||||
});
|
||||
$('input[name="multicurrency_price"], input[name="multicurrency_tx"]').on('paste', function () {
|
||||
update_price_from_multicurrency();
|
||||
});
|
||||
|
||||
@ -698,7 +732,9 @@ if ($id > 0 || $ref) {
|
||||
|
||||
var currencies_array = $currencies;
|
||||
$('select[name="multicurrency_code"]').change(function () {
|
||||
console.log("We change the currency");
|
||||
$('input[name="multicurrency_tx"]').val(currencies_array[$(this).val()]);
|
||||
update_price_from_multicurrency();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -712,7 +748,6 @@ END;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Discount qty min
|
||||
print '<tr><td>'.$langs->trans("DiscountQtyMin").'</td>';
|
||||
print '<td><input class="flat" name="remise_percent" size="4" value="'.(GETPOSTISSET('remise_percent') ? vatrate(price2num(GETPOST('remise_percent'), '', 2)) : (isset($object->fourn_remise_percent) ?vatrate($object->fourn_remise_percent) : '')).'"> %';
|
||||
|
||||
@ -1524,7 +1524,7 @@ class Project extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
$clone_project->datec = $now;
|
||||
$clone_project->date_c = $now;
|
||||
|
||||
if (!$clone_note) {
|
||||
$clone_project->note_private = '';
|
||||
|
||||
@ -223,7 +223,7 @@ if ($resql) {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th colspan="4">'.$langs->trans("LatestModifiedProjects", $max).'</th>';
|
||||
print '<th colspan="5">'.$langs->trans("LatestModifiedProjects", $max).'</th>';
|
||||
print '</tr>';
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
@ -277,12 +277,22 @@ if ($resql) {
|
||||
|
||||
print '</td>';
|
||||
|
||||
// Label
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->title).'">';
|
||||
print $projectstatic->title;
|
||||
print '</td>';
|
||||
|
||||
// Thirdparty
|
||||
print '<td class="nowrap">';
|
||||
if ($companystatic->id > 0) {
|
||||
print $companystatic->getNomUrl(1, 'company', 16);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Date
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
|
||||
|
||||
// Status
|
||||
print '<td class="right">'.$projectstatic->LibStatut($obj->status, 3).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@ -47,13 +47,6 @@ $withproject = GETPOST('withproject', 'int');
|
||||
$project_ref = GETPOST('project_ref', 'alpha');
|
||||
$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : '');
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
if (!$user->rights->projet->lire) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('projecttaskcommentcard', 'globalcard'));
|
||||
|
||||
@ -79,10 +72,21 @@ if (!empty($project_ref) && !empty($withproject)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($id > 0 || $ref) {
|
||||
$object->fetch($id, $ref);
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
|
||||
restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("CommentPage"));
|
||||
|
||||
|
||||
@ -40,17 +40,18 @@ $confirm = GETPOST('confirm', 'alpha');
|
||||
$withproject = GETPOST('withproject', 'int');
|
||||
$project_ref = GETPOST('project_ref', 'alpha');
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
//$result = restrictedArea($user, 'projet', $id, 'projet_task');
|
||||
if (!$user->rights->projet->lire) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$object = new Task($db);
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
if ($id > 0 || $ref) {
|
||||
$object->fetch($id, $ref);
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
|
||||
restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -37,21 +37,13 @@ $langs->loadLangs(array('projects', 'other'));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
|
||||
$mine = GETPOST('mode') == 'mine' ? 1 : 0;
|
||||
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$withproject = GETPOST('withproject', 'int');
|
||||
$project_ref = GETPOST('project_ref', 'alpha');
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
//$result=restrictedArea($user,'projet',$id,'');
|
||||
if (!$user->rights->projet->lire) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Get parameters
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
@ -73,6 +65,17 @@ if (!$sortfield) {
|
||||
$object = new Task($db);
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
if ($id > 0 || $ref) {
|
||||
$object->fetch($id, $ref);
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
|
||||
restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -92,25 +95,21 @@ if (!empty($project_ref) && !empty($withproject)) {
|
||||
}
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
if ($object->fetch($id, $ref) > 0) {
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
|
||||
$object->fetchComments();
|
||||
}
|
||||
$projectstatic->fetch($object->fk_project);
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
|
||||
$projectstatic->fetchComments();
|
||||
}
|
||||
|
||||
if (!empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
|
||||
$object->fetchComments();
|
||||
}
|
||||
$projectstatic->fetch($object->fk_project);
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
|
||||
$projectstatic->fetchComments();
|
||||
}
|
||||
|
||||
if (!empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
|
||||
@ -31,7 +31,7 @@ $langs->load('projects');
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
|
||||
$mine = GETPOST('mode') == 'mine' ? 1 : 0;
|
||||
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
@ -82,6 +82,12 @@ if (!empty($project_ref) && !empty($withproject)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($id > 0 || $ref) {
|
||||
$object->fetch($id, $ref);
|
||||
}
|
||||
|
||||
restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
|
||||
|
||||
$permissionnote = ($user->rights->projet->creer || $user->rights->projet->all->creer);
|
||||
|
||||
|
||||
|
||||
@ -46,13 +46,6 @@ $withproject = GETPOST('withproject', 'int');
|
||||
$project_ref = GETPOST('project_ref', 'alpha');
|
||||
$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : '');
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
if (!$user->rights->projet->lire) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('projecttaskcard', 'globalcard'));
|
||||
|
||||
@ -69,6 +62,17 @@ if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if ($id > 0 || $ref) {
|
||||
$object->fetch($id, $ref);
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
|
||||
restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -85,7 +89,6 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
if (!$error) {
|
||||
$object->fetch($id, $ref);
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$tmparray = explode('_', $_POST['task_parent']);
|
||||
@ -121,17 +124,15 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
|
||||
}
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer) {
|
||||
if ($object->fetch($id, $ref) >= 0) {
|
||||
$result = $projectstatic->fetch($object->fk_project);
|
||||
$projectstatic->fetch_thirdparty();
|
||||
$result = $projectstatic->fetch($object->fk_project);
|
||||
$projectstatic->fetch_thirdparty();
|
||||
|
||||
if ($object->delete($user) > 0) {
|
||||
header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : ''));
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
if ($object->delete($user) > 0) {
|
||||
header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : ''));
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,8 +150,6 @@ if (!empty($project_ref) && !empty($withproject)) {
|
||||
|
||||
// Build doc
|
||||
if ($action == 'builddoc' && $user->rights->projet->creer) {
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
// Save last template used to generate document
|
||||
if (GETPOST('model')) {
|
||||
$object->setDocModel($user, GETPOST('model', 'alpha'));
|
||||
@ -172,17 +171,15 @@ if ($action == 'builddoc' && $user->rights->projet->creer) {
|
||||
if ($action == 'remove_file' && $user->rights->projet->creer) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
if ($object->fetch($id, $ref) >= 0) {
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->projet->dir_output;
|
||||
$file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->projet->dir_output;
|
||||
$file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
|
||||
|
||||
$ret = dol_delete_file($file);
|
||||
if ($ret) {
|
||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
}
|
||||
$ret = dol_delete_file($file);
|
||||
if ($ret) {
|
||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,452 +195,450 @@ $formother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
if ($object->fetch($id, $ref) > 0) {
|
||||
$res = $object->fetch_optionals();
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
|
||||
$object->fetchComments();
|
||||
$res = $object->fetch_optionals();
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
|
||||
$object->fetchComments();
|
||||
}
|
||||
|
||||
$result = $projectstatic->fetch($object->fk_project);
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
|
||||
$projectstatic->fetchComments();
|
||||
}
|
||||
if (!empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
//$userWrite = $projectstatic->restrictedProjectArea($user, 'write');
|
||||
|
||||
if (!empty($withproject)) {
|
||||
// Tabs for project
|
||||
$tab = 'tasks';
|
||||
$head = project_prepare_head($projectstatic);
|
||||
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
|
||||
|
||||
$param = ($mode == 'mine' ? '&mode=mine' : '');
|
||||
|
||||
// Project card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
// Title
|
||||
$morehtmlref .= $projectstatic->title;
|
||||
// Thirdparty
|
||||
if ($projectstatic->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (!$user->rights->projet->all->lire) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
||||
$result = $projectstatic->fetch($object->fk_project);
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
|
||||
$projectstatic->fetchComments();
|
||||
}
|
||||
if (!empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
$object->project = clone $projectstatic;
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
//$userWrite = $projectstatic->restrictedProjectArea($user, 'write');
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
if (!empty($withproject)) {
|
||||
// Tabs for project
|
||||
$tab = 'tasks';
|
||||
$head = project_prepare_head($projectstatic);
|
||||
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
|
||||
|
||||
$param = ($mode == 'mine' ? '&mode=mine' : '');
|
||||
|
||||
// Project card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
// Title
|
||||
$morehtmlref .= $projectstatic->title;
|
||||
// Thirdparty
|
||||
if ($projectstatic->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
// Usage
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
|
||||
print '<tr><td class="tdtop">';
|
||||
print $langs->trans("Usage");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectFollowOpportunity");
|
||||
print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (!$user->rights->projet->all->lire) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
|
||||
print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectFollowTasks");
|
||||
print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Usage
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
|
||||
print '<tr><td class="tdtop">';
|
||||
print $langs->trans("Usage");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectFollowOpportunity");
|
||||
print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
|
||||
print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectFollowTasks");
|
||||
print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
|
||||
print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectBillTimeDescription");
|
||||
print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
if (!empty($conf->eventorganization->enabled)) {
|
||||
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("EventOrganizationDescriptionLong");
|
||||
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
|
||||
}
|
||||
print '</td></tr>';
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
|
||||
print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectBillTimeDescription");
|
||||
print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print $langs->trans('PrivateProject');
|
||||
if (!empty($conf->eventorganization->enabled)) {
|
||||
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("EventOrganizationDescriptionLong");
|
||||
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start - end
|
||||
print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
|
||||
$start = dol_print_date($projectstatic->date_start, 'day');
|
||||
print ($start ? $start : '?');
|
||||
$end = dol_print_date($projectstatic->date_end, 'day');
|
||||
print ' - ';
|
||||
print ($end ? $end : '?');
|
||||
if ($projectstatic->hasDelay()) {
|
||||
print img_warning("Late");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($projectstatic->budget_amount, '')) {
|
||||
print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($projectstatic->id, 'project', 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
/*print '<div class="tabsAction">';
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
|
||||
{
|
||||
if ($projectstatic->public || $userWrite > 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create'.$param.'">'.$langs->trans('AddTask').'</a>';
|
||||
// Date start - end
|
||||
print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
|
||||
$start = dol_print_date($projectstatic->date_start, 'day');
|
||||
print ($start ? $start : '?');
|
||||
$end = dol_print_date($projectstatic->date_end, 'day');
|
||||
print ' - ';
|
||||
print ($end ? $end : '?');
|
||||
if ($projectstatic->hasDelay()) {
|
||||
print img_warning("Late");
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTask').'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTask').'</a>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($projectstatic->budget_amount, '')) {
|
||||
print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
*/
|
||||
|
||||
// To verify role of users
|
||||
//$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
|
||||
//$arrayofuseridoftask=$object->getListContactId('internal');
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
$head = task_prepare_head($object);
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if ($action == 'edit' && $user->rights->projet->creer) {
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', '');
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($projectstatic->id, 'project', 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '</table>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Ref").'</td>';
|
||||
print '<td><input class="minwidth100" name="taskref" value="'.$object->ref.'"></td></tr>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
print '<td><input class="minwidth500" name="label" value="'.$object->label.'"></td></tr>';
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
// Project
|
||||
if (empty($withproject)) {
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// Third party
|
||||
print '<td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
|
||||
if ($projectstatic->societe->id) {
|
||||
print $projectstatic->societe->getNomUrl(1);
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
/*print '<div class="tabsAction">';
|
||||
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
|
||||
{
|
||||
if ($projectstatic->public || $userWrite > 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create'.$param.'">'.$langs->trans('AddTask').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTask').'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTask').'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
*/
|
||||
|
||||
// To verify role of users
|
||||
//$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
|
||||
//$arrayofuseridoftask=$object->getListContactId('internal');
|
||||
|
||||
$head = task_prepare_head($object);
|
||||
|
||||
if ($action == 'edit' && $user->rights->projet->creer) {
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', '');
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Ref").'</td>';
|
||||
print '<td><input class="minwidth100" name="taskref" value="'.$object->ref.'"></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
print '<td><input class="minwidth500" name="label" value="'.$object->label.'"></td></tr>';
|
||||
|
||||
// Project
|
||||
if (empty($withproject)) {
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Third party
|
||||
print '<td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
|
||||
if ($projectstatic->societe->id) {
|
||||
print $projectstatic->societe->getNomUrl(1);
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
|
||||
// Task parent
|
||||
print '<tr><td>'.$langs->trans("ChildOfProjectTask").'</td><td>';
|
||||
print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print $form->selectDate($object->date_start, 'dateo', 1, 1, 0, '', 1, 0);
|
||||
print '</td></tr>';
|
||||
// Task parent
|
||||
print '<tr><td>'.$langs->trans("ChildOfProjectTask").'</td><td>';
|
||||
print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id);
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("Deadline").'</td><td>';
|
||||
print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0);
|
||||
print '</td></tr>';
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print $form->selectDate($object->date_start, 'dateo', 1, 1, 0, '', 1, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
|
||||
print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text');
|
||||
print '</td></tr>';
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("Deadline").'</td><td>';
|
||||
print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress declared
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td>';
|
||||
print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1);
|
||||
print '</td></tr>';
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
|
||||
print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text');
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
print '<textarea name="description" class="quatrevingtpercent" rows="'.ROWS_4.'">'.$object->description.'</textarea>';
|
||||
print '</td></tr>';
|
||||
// Progress declared
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td>';
|
||||
print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Other options
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
print '<textarea name="description" class="quatrevingtpercent" rows="'.ROWS_4.'">'.$object->description.'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
// Other options
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
||||
print dol_get_fiche_end();
|
||||
print '</table>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="update" value="'.$langs->trans("Modify").'"> ';
|
||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="update" value="'.$langs->trans("Modify").'"> ';
|
||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
/*
|
||||
* Fiche tache en mode visu
|
||||
*/
|
||||
$param = ($withproject ? '&withproject=1' : '');
|
||||
$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'&restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>' : '';
|
||||
|
||||
print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
|
||||
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".GETPOST("id", 'int').'&withproject='.$withproject, $langs->trans("DeleteATask"), $langs->trans("ConfirmDeleteATask"), "confirm_delete");
|
||||
}
|
||||
|
||||
if (!GETPOST('withproject') || empty($projectstatic->id)) {
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
|
||||
$object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")";
|
||||
} else {
|
||||
/*
|
||||
* Fiche tache en mode visu
|
||||
*/
|
||||
$param = ($withproject ? '&withproject=1' : '');
|
||||
$linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'&restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>' : '';
|
||||
|
||||
print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
|
||||
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".GETPOST("id", 'int').'&withproject='.$withproject, $langs->trans("DeleteATask"), $langs->trans("ConfirmDeleteATask"), "confirm_delete");
|
||||
}
|
||||
|
||||
if (!GETPOST('withproject') || empty($projectstatic->id)) {
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
|
||||
$object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")";
|
||||
} else {
|
||||
$object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id);
|
||||
}
|
||||
|
||||
$morehtmlref = '';
|
||||
|
||||
// Project
|
||||
if (empty($withproject)) {
|
||||
$morehtmlref .= '<div class="refidno">';
|
||||
$morehtmlref .= $langs->trans("Project").': ';
|
||||
$morehtmlref .= $projectstatic->getNomUrl(1);
|
||||
$morehtmlref .= '<br>';
|
||||
|
||||
// Third party
|
||||
$morehtmlref .= $langs->trans("ThirdParty").': ';
|
||||
if (!empty($projectstatic->thirdparty)) {
|
||||
$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
}
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Task parent
|
||||
print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
|
||||
if ($object->fk_task_parent > 0) {
|
||||
$tasktmp = new Task($db);
|
||||
$tasktmp->fetch($object->fk_task_parent);
|
||||
print $tasktmp->getNomUrl(1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start - Date end
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td colspan="3">';
|
||||
$start = dol_print_date($object->date_start, 'dayhour');
|
||||
print ($start ? $start : '?');
|
||||
$end = dol_print_date($object->date_end, 'dayhour');
|
||||
print ' - ';
|
||||
print ($end ? $end : '?');
|
||||
if ($object->hasDelay()) {
|
||||
print img_warning("Late");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">';
|
||||
if ($object->planned_workload != '') {
|
||||
print convertSecondToTime($object->planned_workload, 'allhourmin');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
print nl2br($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Progress declared
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
if ($object->progress != '') {
|
||||
print $object->progress.' %';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress calculated
|
||||
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
|
||||
if ($object->planned_workload != '') {
|
||||
$tmparray = $object->getSummaryOfTimeSpent();
|
||||
if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) {
|
||||
print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
|
||||
} else {
|
||||
print '0 %';
|
||||
}
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 3;
|
||||
$parameters = array('socid'=>$socid);
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
$object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id);
|
||||
}
|
||||
|
||||
$morehtmlref = '';
|
||||
|
||||
if ($action != 'edit') {
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
// Project
|
||||
if (empty($withproject)) {
|
||||
$morehtmlref .= '<div class="refidno">';
|
||||
$morehtmlref .= $langs->trans("Project").': ';
|
||||
$morehtmlref .= $projectstatic->getNomUrl(1);
|
||||
$morehtmlref .= '<br>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
// Third party
|
||||
$morehtmlref .= $langs->trans("ThirdParty").': ';
|
||||
if (!empty($projectstatic->thirdparty)) {
|
||||
$morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if (empty($reshook)) {
|
||||
// Modify
|
||||
if ($user->rights->projet->creer) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&withproject='.$withproject.'">'.$langs->trans('Modify').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
|
||||
|
||||
// Delete
|
||||
if ($user->rights->projet->supprimer) {
|
||||
if (!$object->hasChildren() && !$object->hasTimeSpent()) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.$withproject.'">'.$langs->trans('Delete').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("TaskHasChild").'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
print '</div>';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Task parent
|
||||
print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
|
||||
if ($object->fk_task_parent > 0) {
|
||||
$tasktmp = new Task($db);
|
||||
$tasktmp->fetch($object->fk_task_parent);
|
||||
print $tasktmp->getNomUrl(1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start - Date end
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td colspan="3">';
|
||||
$start = dol_print_date($object->date_start, 'dayhour');
|
||||
print ($start ? $start : '?');
|
||||
$end = dol_print_date($object->date_end, 'dayhour');
|
||||
print ' - ';
|
||||
print ($end ? $end : '?');
|
||||
if ($object->hasDelay()) {
|
||||
print img_warning("Late");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">';
|
||||
if ($object->planned_workload != '') {
|
||||
print convertSecondToTime($object->planned_workload, 'allhourmin');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
print nl2br($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Progress declared
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
if ($object->progress != '') {
|
||||
print $object->progress.' %';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress calculated
|
||||
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
|
||||
if ($object->planned_workload != '') {
|
||||
$tmparray = $object->getSummaryOfTimeSpent();
|
||||
if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) {
|
||||
print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
|
||||
} else {
|
||||
print '0 %';
|
||||
}
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 3;
|
||||
$parameters = array('socid'=>$socid);
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
if ($action != 'edit') {
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if (empty($reshook)) {
|
||||
// Modify
|
||||
if ($user->rights->projet->creer) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&withproject='.$withproject.'">'.$langs->trans('Modify').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
// Delete
|
||||
if ($user->rights->projet->supprimer) {
|
||||
if (!$object->hasChildren() && !$object->hasTimeSpent()) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.$withproject.'">'.$langs->trans('Delete').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("TaskHasChild").'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Generated documents
|
||||
*/
|
||||
$filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed = ($user->rights->projet->lire);
|
||||
$delallowed = ($user->rights->projet->creer);
|
||||
|
||||
print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
|
||||
$formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
|
||||
|
||||
print '</div></div></div>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
/*
|
||||
* Generated documents
|
||||
*/
|
||||
$filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed = ($user->rights->projet->lire);
|
||||
$delallowed = ($user->rights->projet->creer);
|
||||
|
||||
print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
|
||||
$formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -107,6 +107,13 @@ $extrafields = new ExtraFields($db);
|
||||
$extrafields->fetch_name_optionals_label($projectstatic->table_element);
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
if ($id > 0 || $ref) {
|
||||
$object->fetch($id, $ref);
|
||||
}
|
||||
|
||||
restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -1073,6 +1080,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as inv ON inv.rowid = il.fk_facture,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
|
||||
|
||||
if (empty($projectidforalltimes)) {
|
||||
$sql .= " AND t.fk_task =".((int) $object->id);
|
||||
} else {
|
||||
@ -1088,7 +1096,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
|
||||
$sql .= natural_search('pt.label', $search_task_label);
|
||||
}
|
||||
if ($search_user > 0) {
|
||||
$sql .= natural_search('t.fk_user', $search_user);
|
||||
$sql .= natural_search('t.fk_user', $search_user, 2);
|
||||
}
|
||||
if ($search_valuebilled == '1') {
|
||||
$sql .= ' AND t.invoice_id > 0';
|
||||
@ -1103,6 +1111,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if (! $resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
$page = 0;
|
||||
|
||||
@ -64,19 +64,21 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
|
||||
global $dolibarr_main_instance_unique_id;
|
||||
global $dolibarr_main_url_root;
|
||||
|
||||
// Init vars
|
||||
$errmsg = '';
|
||||
$num = 0;
|
||||
$error = 0;
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$email = GETPOST("email");
|
||||
$societe = GETPOST("societe");
|
||||
$emailcompany = GETPOST("emailcompany");
|
||||
$note_public = GETPOST('note_public', "nohtml");
|
||||
|
||||
// Getting id from Post and decoding it
|
||||
$type = GETPOST('type', 'aZ09');
|
||||
@ -234,7 +236,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
||||
// If the price has been set, name is required for the invoice
|
||||
if (!GETPOST("societe") && !empty(floatval($project->price_registration))) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."<br>\n";
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company"))."<br>\n";
|
||||
}
|
||||
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
||||
$error++;
|
||||
@ -269,6 +271,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
||||
$confattendee->email = $email;
|
||||
$confattendee->fk_project = $project->id;
|
||||
$confattendee->fk_actioncomm = $id;
|
||||
$confattendee->note_public = $note_public;
|
||||
$resultconfattendee = $confattendee->create($user);
|
||||
if ($resultconfattendee < 0) {
|
||||
$error++;
|
||||
@ -293,7 +296,9 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
||||
exit;
|
||||
}
|
||||
|
||||
$resultfetchthirdparty = -1;
|
||||
$resultfetchthirdparty = 0;
|
||||
|
||||
$genericcompanyname = $langs->trans('EventParticipant').' '.($emailcompany ? $emailcompany : $email); // Keep this label simple so we can retreive same thirdparty for another event
|
||||
|
||||
// Getting the thirdparty or creating it
|
||||
$thirdparty = new Societe($db);
|
||||
@ -303,45 +308,104 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
||||
$resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc);
|
||||
} else {
|
||||
if (empty($conf->global->EVENTORGANIZATION_DISABLE_RETREIVE_THIRDPARTY_FROM_NAME)) {
|
||||
// Fetch using the input field by user if we just created the attendee
|
||||
if (!empty($societe)) {
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email);
|
||||
if ($resultfetchthirdparty <= 0) {
|
||||
// Try to find the thirdparty from the contact
|
||||
$resultfetchcontact = $contact->fetch('', null, '', $email);
|
||||
if ($resultfetchcontact <= 0 || $contact->fk_soc <= 0) {
|
||||
// Need to create a new one (not found or multiple with the same name/email)
|
||||
$resultfetchthirdparty = 0;
|
||||
} else {
|
||||
$thirdparty->fetch($contact->fk_soc);
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
$resultfetchthirdparty = 1;
|
||||
}
|
||||
} else {
|
||||
// We found a unique result with that name/email, so we set the fk_soc of attendee
|
||||
// Fetch using the field input by end user if we have just created the attendee
|
||||
if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($emailcompany)) {
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $emailcompany);
|
||||
if ($resultfetchthirdparty > 0) {
|
||||
// We found a unique result with the name + emailcompany, so we set the fk_soc of attendee
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
} elseif ($resultfetchthirdparty == -2) {
|
||||
$thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
|
||||
}
|
||||
} else {
|
||||
// Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences)
|
||||
$resultfetchthirdparty = 0;
|
||||
}
|
||||
} else {
|
||||
// Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences)
|
||||
$resultfetchthirdparty = 0;
|
||||
// Fetch using the field input by end user if we have just created the attendee
|
||||
if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($email) && $email != $emailcompany) {
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email);
|
||||
if ($resultfetchthirdparty > 0) {
|
||||
// We found a unique result with the name + email, so we set the fk_soc of attendee
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
} elseif ($resultfetchthirdparty == -2) {
|
||||
$thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($resultfetchthirdparty <= 0 && !empty($emailcompany)) {
|
||||
// Try to find thirdparty from the email only
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $emailcompany);
|
||||
if ($resultfetchthirdparty > 0) {
|
||||
// We found a unique result with that email only, so we set the fk_soc of attendee
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
} elseif ($resultfetchthirdparty == -2) {
|
||||
$thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email);
|
||||
}
|
||||
}
|
||||
if ($resultfetchthirdparty <= 0 && !empty($email) && $email != $emailcompany) {
|
||||
// Try to find thirdparty from the email only
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email);
|
||||
if ($resultfetchthirdparty > 0) {
|
||||
// We found a unique result with that email only, so we set the fk_soc of attendee
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
} elseif ($resultfetchthirdparty == -2) {
|
||||
$thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email);
|
||||
}
|
||||
}
|
||||
if ($resultfetchthirdparty <= 0 && !empty($genericcompanyname)) {
|
||||
// Try to find thirdparty from the generic mail only
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', $genericcompanyname, '', '', '', '', '', '', '', '', '');
|
||||
if ($resultfetchthirdparty > 0) {
|
||||
// We found a unique result with that name + email, so we set the fk_soc of attendee
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
} elseif ($resultfetchthirdparty == -2) {
|
||||
$thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Add more tests on a VAT number, profid or a name ?
|
||||
|
||||
if ($resultfetchthirdparty <= 0 && !empty($email)) {
|
||||
// Try to find the thirdparty from the contact
|
||||
$resultfetchcontact = $contact->fetch('', null, '', $email);
|
||||
if ($resultfetchcontact > 0 && $contact->fk_soc > 0) {
|
||||
$thirdparty->fetch($contact->fk_soc);
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
$resultfetchthirdparty = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($resultfetchthirdparty <= 0 && !empty($societe)) {
|
||||
// Try to find thirdparty from the company name only
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', '');
|
||||
if ($resultfetchthirdparty > 0) {
|
||||
// We found a unique result with that name only, so we set the fk_soc of attendee
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
} elseif ($resultfetchthirdparty == -2) {
|
||||
$thirdparty->error = "ErrorSeveralCompaniesWithNameContactUs";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If price is empty, no need to create a thirdparty, so we force $resultfetchthirdparty as if we have already found thirdp party.
|
||||
if (empty(floatval($project->price_registration))) {
|
||||
$resultfetchthirdparty = 1;
|
||||
}
|
||||
|
||||
if ($resultfetchthirdparty < 0) {
|
||||
// If an error was found
|
||||
$error++;
|
||||
$errmsg .= $thirdparty->error;
|
||||
} elseif ($resultfetchthirdparty == 0) {
|
||||
} elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected
|
||||
// Creation of a new thirdparty
|
||||
if (!empty($societe)) {
|
||||
$thirdparty->name = $societe;
|
||||
} else {
|
||||
$thirdparty->name = $email;
|
||||
$thirdparty->name = $genericcompanyname;
|
||||
}
|
||||
$thirdparty->address = GETPOST("address");
|
||||
$thirdparty->zip = GETPOST("zipcode");
|
||||
@ -350,7 +414,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
||||
$thirdparty->fournisseur = 0;
|
||||
$thirdparty->country_id = GETPOST("country_id", 'int');
|
||||
$thirdparty->state_id = GETPOST("state_id", 'int');
|
||||
$thirdparty->email = $email;
|
||||
$thirdparty->email = ($emailcompany ? $emailcompany : $email);
|
||||
|
||||
// Load object modCodeTiers
|
||||
$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
|
||||
@ -386,8 +450,10 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// If the registration needs a payment
|
||||
if (!empty(floatval($project->price_registration))) {
|
||||
$outputlangs = $langs;
|
||||
|
||||
// TODO Use default language of $thirdparty->default_lang to build $outputlang
|
||||
|
||||
// Get product to use for invoice
|
||||
@ -405,30 +471,41 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
||||
$errmsg .= $productforinvoicerow->error;
|
||||
} else {
|
||||
$facture = new Facture($db);
|
||||
$facture->type = Facture::TYPE_STANDARD;
|
||||
$facture->socid = $thirdparty->id;
|
||||
$facture->paye = 0;
|
||||
$facture->date = dol_now();
|
||||
$facture->cond_reglement_id = $confattendee->cond_reglement_id;
|
||||
$facture->fk_project = $project->id;
|
||||
if (empty($confattendee->fk_invoice)) {
|
||||
$facture->type = Facture::TYPE_STANDARD;
|
||||
$facture->socid = $thirdparty->id;
|
||||
$facture->paye = 0;
|
||||
$facture->date = dol_now();
|
||||
$facture->cond_reglement_id = $confattendee->cond_reglement_id;
|
||||
$facture->fk_project = $project->id;
|
||||
$facture->status = Facture::STATUS_DRAFT;
|
||||
|
||||
if (empty($facture->cond_reglement_id)) {
|
||||
$paymenttermstatic = new PaymentTerm($confattendee->db);
|
||||
$facture->cond_reglement_id = $paymenttermstatic->getDefaultId();
|
||||
if (empty($facture->cond_reglement_id)) {
|
||||
$error++;
|
||||
$confattendee->error = 'ErrorNoPaymentTermRECEPFound';
|
||||
$confattendee->errors[] = $confattendee->error;
|
||||
$paymenttermstatic = new PaymentTerm($confattendee->db);
|
||||
$facture->cond_reglement_id = $paymenttermstatic->getDefaultId();
|
||||
if (empty($facture->cond_reglement_id)) {
|
||||
$error++;
|
||||
$confattendee->error = 'ErrorNoPaymentTermRECEPFound';
|
||||
$confattendee->errors[] = $confattendee->error;
|
||||
}
|
||||
}
|
||||
$resultfacture = $facture->create($user);
|
||||
if ($resultfacture <= 0) {
|
||||
$confattendee->error = $facture->error;
|
||||
$confattendee->errors = $facture->errors;
|
||||
$error++;
|
||||
} else {
|
||||
$confattendee->fk_invoice = $resultfacture;
|
||||
$confattendee->update($user);
|
||||
}
|
||||
}
|
||||
$resultfacture = $facture->create($user);
|
||||
if ($resultfacture <= 0) {
|
||||
$confattendee->error = $facture->error;
|
||||
$confattendee->errors = $facture->errors;
|
||||
$error++;
|
||||
} else {
|
||||
$facture->add_object_linked($confattendee->element, $confattendee->id);
|
||||
$facture->fetch($confattendee->fk_invoice);
|
||||
}
|
||||
|
||||
// Add link between invoice and the attendee registration
|
||||
/*if (!$error) {
|
||||
$facture->add_object_linked($confattendee->element, $confattendee->id);
|
||||
}*/
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@ -439,11 +516,14 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
||||
$date_start = $project->date_start;
|
||||
$date_end = $project->date_end;
|
||||
|
||||
$result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1);
|
||||
if ($result <= 0) {
|
||||
$confattendee->error = $facture->error;
|
||||
$confattendee->errors = $facture->errors;
|
||||
$error++;
|
||||
// If there is no lines yet, we add one
|
||||
if (empty($facture->lines)) {
|
||||
$result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1);
|
||||
if ($result <= 0) {
|
||||
$confattendee->error = $facture->error;
|
||||
$confattendee->errors = $facture->errors;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -610,7 +690,10 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
|
||||
print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n";
|
||||
|
||||
// Email
|
||||
print '<tr><td>' . $langs->trans("Email") . '<font color="red">*</font></td><td><input type="text" name="email" maxlength="255" class="minwidth200" value="' . dol_escape_htmltag(GETPOST('email')) . '"></td></tr>' . "\n";
|
||||
print '<tr><td>' . $langs->trans("EmailAttendee") . '<font color="red">*</font></td><td>';
|
||||
print img_picto('', 'email', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="email" maxlength="255" class="minwidth200" value="' . dol_escape_htmltag(GETPOST('email')) . '"></td></tr>' . "\n";
|
||||
|
||||
// Company
|
||||
print '<tr id="trcompany" class="trcompany"><td>' . $langs->trans("Company");
|
||||
if (!empty(floatval($project->price_registration))) {
|
||||
@ -619,15 +702,25 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
|
||||
print ' </td><td>';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="societe" class="minwidth200" value="' . dol_escape_htmltag(GETPOST('societe')) . '"></td></tr>' . "\n";
|
||||
|
||||
// Email company for invoice
|
||||
if ($project->price_registration) {
|
||||
print '<tr><td>' . $langs->trans("EmailCompanyForInvoice") . '</td><td>';
|
||||
print img_picto('', 'email', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="emailcompany" maxlength="255" class="minwidth200" value="' . dol_escape_htmltag(GETPOST('emailcompany')) . '"></td></tr>' . "\n";
|
||||
}
|
||||
|
||||
// Address
|
||||
print '<tr><td>' . $langs->trans("Address") . '</td><td>' . "\n";
|
||||
print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="' . ROWS_3 . '">' . dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1) . '</textarea></td></tr>' . "\n";
|
||||
print '<textarea name="address" id="address" wrap="soft" class="centpercent" rows="' . ROWS_2 . '">' . dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1) . '</textarea></td></tr>' . "\n";
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . '</td><td>';
|
||||
print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
|
||||
print ' / ';
|
||||
print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>' . $langs->trans('Country') . '<font color="red">*</font></td><td>';
|
||||
print img_picto('', 'country', 'class="pictofixedwidth"');
|
||||
@ -666,6 +759,14 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
$notetoshow = $note_public;
|
||||
print '<tr><td>' . $langs->trans('Note') . '</td><td>';
|
||||
if (!empty($conf->global->EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION)) {
|
||||
$notetoshow = str_replace('\n', "\n", $conf->global->EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION);
|
||||
}
|
||||
print '<textarea name="note_public" class="centpercent" rows="'.ROWS_9.'">'.dol_escape_htmltag($notetoshow, 0, 1).'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -115,6 +115,8 @@ if (!$action) {
|
||||
|
||||
if ($source == 'organizedeventregistration') {
|
||||
// Finding the Attendee
|
||||
$attendee = new ConferenceOrBoothAttendee($db);
|
||||
|
||||
$invoiceid = GETPOST('ref', 'int');
|
||||
$invoice = new Facture($db);
|
||||
|
||||
@ -123,14 +125,28 @@ if ($source == 'organizedeventregistration') {
|
||||
if ($resultinvoice <= 0) {
|
||||
setEventMessages(null, $invoice->errors, "errors");
|
||||
} else {
|
||||
/*
|
||||
$attendeeid = 0;
|
||||
|
||||
$invoice->fetchObjectLinked();
|
||||
$linkedAttendees = $invoice->linkedObjectsIds['conferenceorboothattendee'];
|
||||
|
||||
if (is_array($linkedAttendees)) {
|
||||
$linkedAttendees = array_values($linkedAttendees);
|
||||
$attendeeid = $linkedAttendees[0];
|
||||
}*/
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
|
||||
$sql .= " WHERE fk_invoice = ".((int) $invoiceid);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
$attendeeid = $obj->rowid;
|
||||
}
|
||||
}
|
||||
|
||||
$attendee = new ConferenceOrBoothAttendee($db);
|
||||
$resultattendee = $attendee->fetch($linkedAttendees[0]);
|
||||
if ($attendeeid > 0) {
|
||||
$resultattendee = $attendee->fetch($attendeeid);
|
||||
|
||||
if ($resultattendee <= 0) {
|
||||
setEventMessages(null, $attendee->errors, "errors");
|
||||
@ -1834,12 +1850,13 @@ if ($source == 'organizedeventregistration') {
|
||||
// Debitor
|
||||
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Attendee");
|
||||
print '</td><td class="CTableRow2"><b>';
|
||||
print $thirdparty->name;
|
||||
print $attendee->email;
|
||||
print ($thirdparty->name ? ' ('.$langs->trans("Company").' '.$thirdparty->name.')' : '');
|
||||
print '</b>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (! is_object($attendee->project)) {
|
||||
$text = 'ErrorProjectotFound';
|
||||
$text = 'ErrorProjectNotFound';
|
||||
} else {
|
||||
$text = $langs->trans("PaymentEvent").' - '.$attendee->project->title;
|
||||
}
|
||||
|
||||
@ -932,7 +932,7 @@ if ($ispaymentok) {
|
||||
}
|
||||
|
||||
// TODO send email with acknowledgment for the donation
|
||||
// (need that the donation module can gen a pdf document for the cerfa with pre filled content)
|
||||
// (we need first that the donation module is able to generate a pdf document for the cerfa with pre filled content)
|
||||
} elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) {
|
||||
// Record payment for registration to an event for an attendee
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
@ -573,43 +573,43 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
if ($sall) {
|
||||
$param .= "&sall=".urlencode($sall);
|
||||
$param .= "&sall=".urlencode($sall);
|
||||
}
|
||||
if ($search_ref_rcp) {
|
||||
$param .= "&search_ref_rcp=".urlencode($search_ref_rcp);
|
||||
$param .= "&search_ref_rcp=".urlencode($search_ref_rcp);
|
||||
}
|
||||
if ($search_ref_liv) {
|
||||
$param .= "&search_ref_liv=".urlencode($search_ref_liv);
|
||||
$param .= "&search_ref_liv=".urlencode($search_ref_liv);
|
||||
}
|
||||
if ($search_company) {
|
||||
$param .= "&search_company=".urlencode($search_company);
|
||||
$param .= "&search_company=".urlencode($search_company);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
if ($search_billed != '' && $search_billed >= 0) {
|
||||
$param .= "&search_billed=".urlencode($search_billed);
|
||||
$param .= "&search_billed=".urlencode($search_billed);
|
||||
}
|
||||
if ($search_town) {
|
||||
$param .= "&search_town=".urlencode($search_town);
|
||||
$param .= "&search_town=".urlencode($search_town);
|
||||
}
|
||||
if ($search_zip) {
|
||||
$param .= "&search_zip=".urlencode($search_zip);
|
||||
$param .= "&search_zip=".urlencode($search_zip);
|
||||
}
|
||||
if ($search_state) {
|
||||
$param .= "&search_state=".urlencode($search_state);
|
||||
$param .= "&search_state=".urlencode($search_state);
|
||||
}
|
||||
if ($search_status != '') {
|
||||
$param .= "&search_status=".urlencode($search_status);
|
||||
$param .= "&search_status=".urlencode($search_status);
|
||||
}
|
||||
if ($search_country) {
|
||||
$param .= "&search_country=".urlencode($search_country);
|
||||
$param .= "&search_country=".urlencode($search_country);
|
||||
}
|
||||
if ($search_type_thirdparty) {
|
||||
$param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty);
|
||||
$param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty);
|
||||
}
|
||||
if ($search_ref_supplier) {
|
||||
$param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
|
||||
$param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
|
||||
}
|
||||
// Add $param from extra fields
|
||||
foreach ($search_array_options as $key => $val) {
|
||||
@ -885,7 +885,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Ref
|
||||
if (!empty($arrayfields['e.ref']['checked'])) {
|
||||
print "<td>";
|
||||
print '<td class="nowraponall">';
|
||||
print $reception->getNomUrl(1);
|
||||
$filename = dol_sanitizeFileName($reception->ref);
|
||||
$filedir = $conf->reception->dir_output.'/'.dol_sanitizeFileName($reception->ref);
|
||||
@ -898,10 +898,10 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Ref customer
|
||||
// Ref supplier
|
||||
if (!empty($arrayfields['e.ref_supplier']['checked'])) {
|
||||
print "<td>";
|
||||
print $obj->ref_supplier;
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->ref_supplier).'">';
|
||||
print dol_escape_htmltag($obj->ref_supplier);
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -910,7 +910,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Third party
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $companystatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -919,8 +919,8 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Town
|
||||
if (!empty($arrayfields['s.town']['checked'])) {
|
||||
print '<td class="nocellnopadd">';
|
||||
print $obj->town;
|
||||
print '<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->town).'">';
|
||||
print dol_escape_htmltag($obj->town);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -928,8 +928,8 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Zip
|
||||
if (!empty($arrayfields['s.zip']['checked'])) {
|
||||
print '<td class="nocellnopadd">';
|
||||
print $obj->zip;
|
||||
print '<td class="nocellnopadd center"">';
|
||||
print dol_escape_htmltag($obj->zip);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -937,7 +937,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// State
|
||||
if (!empty($arrayfields['state.nom']['checked'])) {
|
||||
print "<td>".$obj->state_name."</td>\n";
|
||||
print "<td>".dol_escape_htmltag($obj->state_name)."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -946,7 +946,7 @@ while ($i < min($num, $limit)) {
|
||||
if (!empty($arrayfields['country.code_iso']['checked'])) {
|
||||
print '<td class="center">';
|
||||
$tmparray = getCountry($obj->fk_pays, 'all');
|
||||
print $tmparray['label'];
|
||||
print dol_escape_htmltag($tmparray['label']);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@ -2581,7 +2581,7 @@ class Societe extends CommonObject
|
||||
$label .= ' ('.dol_escape_htmltag($this->name_alias).')';
|
||||
}
|
||||
}
|
||||
$label .= '<br><b>'.$langs->trans('Email').':</b> '.$this->email;
|
||||
$label .= '<br>'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email;
|
||||
if (!empty($this->phone) || !empty($this->fax)) {
|
||||
$phonelist = array();
|
||||
if ($this->phone) {
|
||||
@ -2590,7 +2590,7 @@ class Societe extends CommonObject
|
||||
if ($this->fax) {
|
||||
$phonelist[] = dol_print_phone($this->fax, $this->country_code, $this->id, 0, '', ' ', 'fax');
|
||||
}
|
||||
$label .= '<br><b>'.$langs->trans('Phone').':</b> '.implode(' ', $phonelist);
|
||||
$label .= '<br>'.implode(' ', $phonelist);
|
||||
}
|
||||
if (!empty($this->address)) {
|
||||
$label .= '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs); // Address + country
|
||||
|
||||
@ -978,36 +978,39 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
|
||||
<?php
|
||||
|
||||
// TakePOS setup check
|
||||
$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement";
|
||||
$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
|
||||
$sql .= " AND active = 1";
|
||||
$sql .= " ORDER BY libelle";
|
||||
if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) {
|
||||
$sql = "SELECT code, libelle FROM " . MAIN_DB_PREFIX . "c_paiement";
|
||||
$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
|
||||
$sql .= " AND active = 1";
|
||||
$sql .= " ORDER BY libelle";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$paiementsModes = array();
|
||||
if ($resql) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$paycode = $obj->code;
|
||||
if ($paycode == 'LIQ') {
|
||||
$paycode = 'CASH';
|
||||
}
|
||||
if ($paycode == 'CHQ') {
|
||||
$paycode = 'CHEQUE';
|
||||
}
|
||||
$resql = $db->query($sql);
|
||||
$paiementsModes = array();
|
||||
if ($resql) {
|
||||
while ( $obj = $db->fetch_object($resql) ) {
|
||||
$paycode = $obj->code;
|
||||
if ($paycode == 'LIQ') {
|
||||
$paycode = 'CASH';
|
||||
}
|
||||
if ($paycode == 'CHQ') {
|
||||
$paycode = 'CHEQUE';
|
||||
}
|
||||
|
||||
$constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
|
||||
//var_dump($constantforkey.' '.$conf->global->$constantforkey);
|
||||
if (!empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
|
||||
array_push($paiementsModes, $obj);
|
||||
$constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
|
||||
//var_dump($constantforkey.' '.$conf->global->$constantforkey);
|
||||
if ( ! empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
|
||||
array_push($paiementsModes, $obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($paiementsModes)) {
|
||||
$langs->load('errors');
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
|
||||
setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($paiementsModes)) {
|
||||
$langs->load('errors');
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
|
||||
setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
|
||||
}
|
||||
if (count($maincategories) == 0) {
|
||||
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) {
|
||||
$tmpcategory = new Categorie($db);
|
||||
|
||||
@ -188,11 +188,9 @@ if ($action == 'valid' && $user->rights->facture->creer) {
|
||||
if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
|
||||
$bankaccount = GETPOST('accountid', 'int');
|
||||
} else {
|
||||
if ($pay == "cash") {
|
||||
if ($pay == 'LIQ') {
|
||||
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||
} elseif ($pay == "card") {
|
||||
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||
} elseif ($pay == "cheque") {
|
||||
} elseif ($pay == "CHQ") {
|
||||
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||
} else {
|
||||
$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
|
||||
|
||||
@ -316,23 +316,20 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
||||
$paycode = $arrayOfValidPaymentModes[0]->code;
|
||||
$payIcon = '';
|
||||
if ($paycode == 'LIQ') {
|
||||
$paycode = 'cash';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'coins';
|
||||
}
|
||||
} elseif ($paycode == 'CB') {
|
||||
$paycode = 'card';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'credit-card';
|
||||
}
|
||||
} elseif ($paycode == 'CHQ') {
|
||||
$paycode = 'cheque';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'money-check';
|
||||
}
|
||||
}
|
||||
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><span class="hideonsmartphone"><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).'</span></button>';
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$paycode.'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><span class="hideonsmartphone"><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).'</span></button>';
|
||||
} else {
|
||||
print '<button type="button" class="calcbutton2">'.$langs->trans("NoPaimementModesDefined").'</button>';
|
||||
}
|
||||
@ -345,23 +342,20 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
||||
$paycode = $arrayOfValidPaymentModes[1]->code;
|
||||
$payIcon = '';
|
||||
if ($paycode == 'LIQ') {
|
||||
$paycode = 'cash';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'coins';
|
||||
}
|
||||
} elseif ($paycode == 'CB') {
|
||||
$paycode = 'card';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'credit-card';
|
||||
}
|
||||
} elseif ($paycode == 'CHQ') {
|
||||
$paycode = 'cheque';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'money-check';
|
||||
}
|
||||
}
|
||||
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br> '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).'</button>';
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$paycode.'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br> '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).'</button>';
|
||||
} else {
|
||||
$button = array_pop($action_buttons);
|
||||
print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
|
||||
@ -375,23 +369,20 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
||||
$paycode = $arrayOfValidPaymentModes[2]->code;
|
||||
$payIcon = '';
|
||||
if ($paycode == 'LIQ') {
|
||||
$paycode = 'cash';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'coins';
|
||||
}
|
||||
} elseif ($paycode == 'CB') {
|
||||
$paycode = 'card';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'credit-card';
|
||||
}
|
||||
} elseif ($paycode == 'CHQ') {
|
||||
$paycode = 'cheque';
|
||||
if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
|
||||
$payIcon = 'money-check';
|
||||
}
|
||||
}
|
||||
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span>'.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? '<br> '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).'</button>';
|
||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$paycode.'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span>'.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? '<br> '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).'</button>';
|
||||
} else {
|
||||
$button = array_pop($action_buttons);
|
||||
print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
|
||||
|
||||
@ -492,7 +492,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setsubject') {
|
||||
if ($action == 'setsubject' && $user->rights->ticket->write) {
|
||||
if ($object->fetch(GETPOST('id', 'int'))) {
|
||||
if ($action == 'setsubject') {
|
||||
$object->subject = GETPOST('subject', 'alphanohtml');
|
||||
|
||||
@ -371,7 +371,7 @@ if ($search_supervisor > 0) {
|
||||
if ($search_thirdparty != '') {
|
||||
$sql .= natural_search(array('s.nom'), $search_thirdparty);
|
||||
}
|
||||
if ($search_warehouse != '') {
|
||||
if ($search_warehouse > 0) {
|
||||
$sql .= natural_search(array('u.fk_warehouse'), $search_warehouse);
|
||||
}
|
||||
if ($search_login != '') {
|
||||
|
||||
@ -3127,7 +3127,7 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
print '</span>'; // end websitetools
|
||||
|
||||
print '<span class="websitehelp">';
|
||||
if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) {
|
||||
if ($action == 'editsource' || $action == 'editcontent' || GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) {
|
||||
$url = 'https://wiki.dolibarr.org/index.php/Module_Website';
|
||||
|
||||
$htmltext = $langs->transnoentitiesnoconv("YouCanEditHtmlSource", $url);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user