Merge remote-tracking branch 'Dolibarr/14.0' into 14

This commit is contained in:
Francis Appels 2021-09-01 10:28:42 +02:00
commit 9ad9145db3
50 changed files with 414 additions and 230 deletions

View File

@ -225,6 +225,13 @@ print '<tr class="oddeven"><td>'.$langs->trans("MemberCreateAnExternalUserForSub
print $form->selectyesno('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', (!empty($conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN) ? $conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN : 0), 1);
print "</td></tr>\n";
// Allow members to change type on renewal forms
/* To test during next beta
print '<tr class="oddeven"><td>'.$langs->trans("MemberAllowchangeOfType").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1);
print "</td></tr>\n";
*/
// Insert subscription into bank account
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
$arraychoices = array('0'=>$langs->trans("None"));

View File

@ -1825,7 +1825,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Show link to invoices
$tmparray = $company->getOutstandingBills('customer');
if (!empty($tmparray['refs'])) {
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").': '.count($tmparray['refs']);
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
// TODO Add alert if warning on at least one invoice late
print '</a>';
}
@ -2010,8 +2010,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Generated documents
$filename = dol_sanitizeFileName($object->ref);
//$filename = 'tmp_cards.php';
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'member');
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed = $user->rights->adherent->lire;
$delallowed = $user->rights->adherent->creer;

View File

@ -2185,6 +2185,9 @@ class Adherent extends CommonObject
if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
}
if (!empty($this->login)) {
$label .= '<br><b>'.$langs->trans('Login').':</b> '.$this->login;
}
if (!empty($this->firstname) || !empty($this->lastname)) {
$label .= '<br><b>'.$langs->trans('Name').':</b> '.$this->getFullName($langs);
}

View File

@ -317,6 +317,7 @@ $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.p
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
$sql .= " d.note_private, d.note_public,";
$sql .= " s.nom,";
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
$sql .= " t.libelle as type, t.subscription,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
// Add fields from extrafields
@ -491,7 +492,7 @@ if (GETPOSTISSET("search_status")) {
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
$titre = $langs->trans("MembersListNotUpToDate");
}
if ($search_status == Adherent::STATUS_RESILIATED) {
if ((string) $search_status == (string) Adherent::STATUS_RESILIATED) { // The cast to string is required to have test false when search_status is ''
$titre = $langs->trans("MembersListResiliated");
}
if ($search_status == Adherent::STATUS_EXCLUDED) {
@ -832,7 +833,7 @@ if (!empty($arrayfields['d.gender']['checked'])) {
print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', $param, "", "", $sortfield, $sortorder);
}
if (!empty($arrayfields['d.company']['checked'])) {
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'd.societe', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'companyname', '', $param, '', $sortfield, $sortorder);
}
if (!empty($arrayfields['d.login']['checked'])) {
print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], 'd.login', '', $param, '', $sortfield, $sortorder);
@ -905,6 +906,7 @@ while ($i < min($num, $limit)) {
$memberstatic->id = $obj->rowid;
$memberstatic->ref = $obj->ref;
$memberstatic->civility_id = $obj->civility;
$memberstatic->login = $obj->login;
$memberstatic->lastname = $obj->lastname;
$memberstatic->firstname = $obj->firstname;
$memberstatic->gender = $obj->gender;
@ -919,9 +921,13 @@ while ($i < min($num, $limit)) {
if (!empty($obj->fk_soc)) {
$memberstatic->fetch_thirdparty();
$companyname = $memberstatic->thirdparty->name;
if ($memberstatic->thirdparty->id > 0) {
$companyname = $memberstatic->thirdparty->name;
$companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
}
} else {
$companyname = $obj->company;
$companynametoshow = $obj->company;
}
$memberstatic->company = $companyname;
@ -984,7 +990,7 @@ while ($i < min($num, $limit)) {
// Company
if (!empty($arrayfields['d.company']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).'">';
print $companyname;
print $companynametoshow;
print "</td>\n";
}
// Login
@ -1094,7 +1100,7 @@ while ($i < min($num, $limit)) {
}
// EMail
if (!empty($arrayfields['d.email']['checked'])) {
print "<td>".dol_print_email($obj->email, 0, 0, 1)."</td>\n";
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->email).'">'.dol_print_email($obj->email, 0, 0, 1)."</td>\n";
}
// End of subscription date
$datefin = $db->jdate($obj->datefin);

View File

@ -612,7 +612,7 @@ if ($rowid > 0) {
// Show link to invoices
$tmparray = $company->getOutstandingBills('customer');
if (!empty($tmparray['refs'])) {
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").': '.count($tmparray['refs']);
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
// TODO Add alert if warning on at least one invoice late
print '</a>';
}

View File

@ -588,6 +588,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
$disabled_modules = array();
if (!empty($_SESSION["disablemodules"])) {
$disabled_modules = explode(',', $_SESSION["disablemodules"]);
}
// Show list of modules
$oldfamily = '';
$foundoneexternalmodulewithupdate = 0;
@ -613,6 +618,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
continue;
}
$modulenameshort = strtolower(preg_replace('/^mod/i', '', get_class($objMod)));
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
// Check filters
@ -754,6 +760,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$codeenabledisable = '';
$codetoconfig = '';
// Force disable of module disabled into session (for demo for example)
if (in_array($modulenameshort, $disabled_modules)) {
$objMod->disabled = true;
}
// Activate/Disable and Setup (2 columns)
if (!empty($conf->global->$const_name)) { // If module is already activated
// Set $codeenabledisable
@ -761,6 +772,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
if (!empty($arrayofwarnings[$modName])) {
$codeenabledisable .= '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
}
if (!empty($objMod->disabled)) {
$codeenabledisable .= $langs->trans("Disabled");
} elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) {

View File

@ -585,12 +585,15 @@ class ActionComm extends CommonObject
//dol_syslog(var_export($this->userassigned, true));
$already_inserted = array();
foreach ($this->userassigned as $key => $val) {
if (!is_array($val)) { // For backward compatibility when val=id
// Common value with new behavior is to have $val = array('id'=>iduser, 'transparency'=>0|1) and $this->userassigned is an array of iduser => $val.
if (!is_array($val)) { // For backward compatibility when $val='id'.
$val = array('id'=>$val);
}
if ($val['id'] > 0) {
if (!empty($already_inserted[$val['id']])) continue;
if (!empty($already_inserted[$val['id']])) {
continue;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql .= " VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory']) ? '0' : $val['mandatory']).", ".(empty($val['transparency']) ? '0' : $val['transparency']).", ".(empty($val['answer_status']) ? '0' : $val['answer_status']).")";
@ -612,7 +615,10 @@ class ActionComm extends CommonObject
if (!empty($this->socpeopleassigned)) {
$already_inserted = array();
foreach ($this->socpeopleassigned as $id => $val) {
if (!empty($already_inserted[$val['id']])) continue;
// Common value with new behavior is to have $val = iduser and $this->socpeopleassigned is an array of iduser => $val.
if (!empty($already_inserted[$id])) {
continue;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql .= " VALUES(".$this->id.", 'socpeople', ".$id.", 0, 0, 0)";
@ -623,7 +629,7 @@ class ActionComm extends CommonObject
dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR);
$this->errors[] = $this->db->lasterror();
} else {
$already_inserted[$val['id']] = true;
$already_inserted[$id] = true;
}
}
}

View File

@ -1625,10 +1625,10 @@ class Facture extends CommonInvoice
}
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$resql = $this->db->query($sql);
if ($resql) {
if ($this->db->num_rows($resql)) {
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->entity = $obj->entity;
@ -1730,14 +1730,18 @@ class Facture extends CommonInvoice
$this->error = $this->db->error();
return -3;
}
$this->db->free($resql);
return 1;
} else {
$this->error = 'Invoice with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found';
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
dol_syslog(__METHOD__ . $this->error, LOG_WARNING);
return 0;
}
} else {
$this->error = $this->db->error();
$this->error = $this->db->lasterror();
return -1;
}
}

View File

@ -181,6 +181,13 @@ class Contrat extends CommonObject
*/
public $lines = array();
public $nbofservices;
public $nbofserviceswait;
public $nbofservicesopened;
public $nbofservicesexpired;
//public $lower_planned_end_date;
//public $higher_planner_end_date;
/**
* Maps ContratLigne IDs to $this->lines indexes
* @var int[]
@ -429,7 +436,8 @@ class Contrat extends CommonObject
foreach ($this->lines as $contratline) {
// Close lines not already closed
if ($contratline->statut != ContratLigne::STATUS_CLOSED) {
$contratline->date_cloture = $now;
$contratline->date_end_real = $now;
$contratline->date_cloture = $now; // For backward compatibility
$contratline->fk_user_cloture = $user->id;
$contratline->statut = ContratLigne::STATUS_CLOSED;
$result = $contratline->close_line($user, $now, $comment, $notrigger);
@ -753,6 +761,7 @@ class Contrat extends CommonObject
// phpcs:enable
global $langs, $conf, $extrafields;
$this->nbofservices = 0;
$this->nbofserviceswait = 0;
$this->nbofservicesopened = 0;
$this->nbofservicesexpired = 0;
@ -2642,10 +2651,23 @@ class ContratLigne extends CommonObjectLine
public $date_end; // date end planned
public $date_end_real; // date end real
// For backward compatibility
/**
* @deprecated Use date_start
*/
public $date_ouverture_prevue; // date start planned
/**
* @deprecated Use date_start_real
*/
public $date_ouverture; // date start real
/**
* @deprecated Use date_end
*/
public $date_fin_validite; // date end planned
/**
* @deprecated Use date_end_real
*/
public $date_cloture; // date end real
public $tva_tx;
public $localtax1_tx;
public $localtax2_tx;
@ -3062,7 +3084,6 @@ class ContratLigne extends CommonObjectLine
$this->oldcopy = new ContratLigne($this->db);
$this->oldcopy->fetch($this->id);
$this->oldcopy->fetch_optionals();
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET";

View File

@ -631,6 +631,8 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
$createbills_onebythird = GETPOST('createbills_onebythird', 'int');
$validate_invoices = GETPOST('validate_invoices', 'int');
$errors = array();
$TFact = array();
$TFactThird = array();
@ -645,18 +647,19 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
if ($cmd->fetch($id_order) <= 0) {
continue;
}
$cmd->fetch_thirdparty();
$objecttmp = new Facture($db);
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) {
$objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
// If option "one bill per third" is set, and an invoice for this thirdparty was already created, we re-use it.
$objecttmp = $TFactThird[$cmd->socid];
} else {
// Load extrafields of order
$cmd->fetch_optionals();
// If we want one invoice per order or if there is no first invoice yet for this thirdparty.
$objecttmp->socid = $cmd->socid;
$objecttmp->type = $objecttmp::TYPE_STANDARD;
$objecttmp->cond_reglement_id = $cmd->cond_reglement_id;
$objecttmp->mode_reglement_id = $cmd->mode_reglement_id;
$objecttmp->cond_reglement_id = ($cmd->cond_reglement_id || $cmd->thirdparty->cond_reglement_id);
$objecttmp->mode_reglement_id = ($cmd->mode_reglement_id || $cmd->thirdparty->mode_reglement_id);
$objecttmp->fk_project = $cmd->fk_project;
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
if (empty($createbills_onebythird)) {
@ -680,23 +683,20 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
$nb_bills_created++;
$lastref = $objecttmp->ref;
$lastid = $objecttmp->id;
$TFactThird[$cmd->socid] = $objecttmp;
} else {
$langs->load("errors");
$errors[] = $cmd->ref.' : '.$langs->trans($objecttmp->error);
$error++;
}
}
if ($objecttmp->id > 0) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
$sql .= "fk_source";
$sql .= ", sourcetype";
$sql .= ", fk_target";
$sql .= ", targettype";
$sql .= ") VALUES (";
$sql .= $id_order;
$sql .= ", '".$db->escape($objecttmp->origin)."'";
$sql .= ", ".$objecttmp->id;
$sql .= ", '".$db->escape($objecttmp->element)."'";
$sql .= ")";
$res = $objecttmp->add_object_linked($objecttmp->origin, $id_order);
if (!$db->query($sql)) {
if ($res == 0) {
$errors[] = $objecttmp->error;
$error++;
}
@ -845,7 +845,6 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
}
$id = $objecttmp->id; // For builddoc action
$object = $objecttmp;
// Builddoc
$donotredirect = 1;
@ -854,7 +853,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
// Call action to build doc
$savobject = $object;
$object = $objecttmp;
$object = $objecttmp;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
$object = $savobject;
}
@ -949,6 +948,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
exit;
} else {
$db->rollback();
$action = 'create';
$_GET["origin"] = $_POST["origin"];
$_GET["originid"] = $_POST["originid"];

View File

@ -3577,7 +3577,7 @@ abstract class CommonObject
* @param string $origin Linked element type
* @param int $origin_id Linked element id
* @param User $f_user User that create
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @return int <=0 if KO, >0 if OK
* @see fetchObjectLinked(), updateObjectLinked(), deleteObjectLinked()
*/
@ -3611,9 +3611,9 @@ abstract class CommonObject
$sql .= ", fk_target";
$sql .= ", targettype";
$sql .= ") VALUES (";
$sql .= $origin_id;
$sql .= ((int) $origin_id);
$sql .= ", '" . $this->db->escape($origin) . "'";
$sql .= ", " . $this->id;
$sql .= ", " . ((int) $this->id);
$sql .= ", '" . $this->db->escape($this->element) . "'";
$sql .= ")";
@ -7496,7 +7496,7 @@ abstract class CommonObject
if ($display_type == 'card') {
$out .= '<tr '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="valuefieldcreate '.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.(!empty($this->id)?'_'.$this->id:'').'" '.$domData.' >';
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && $action == 'view') {
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && ($action == 'view' || $action == 'editline')) {
$out .= '<td></td>';
}
$out .= '<td class="wordbreak';

View File

@ -1157,7 +1157,7 @@ class ExtraFields
} else {
$checked = ' value="1" ';
}
$out = '<input type="checkbox" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.$checked.' '.($moreparam ? $moreparam : '').'>';
$out = '<input type="checkbox" class="flat valignmiddle'.($morecss ? ' '.$morecss : '').' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.$checked.' '.($moreparam ? $moreparam : '').'>';
} else {
$out .= $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1);
}

View File

@ -1413,7 +1413,7 @@ class Form
}
}
if ($showempty) {
$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.$textifempty.'</span>').'">'.$textifempty.'</option>'."\n";
$out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : '&nbsp;').'</span>').'">'.$textifempty.'</option>'."\n";
}
$num = $this->db->num_rows($resql);

View File

@ -263,7 +263,7 @@ class FormTicket
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td>';
print '<span class="span-icon-security inline-block">';
print '<input id="securitycode" placeholder="'.$langs->trans("SecurityCode").'" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />';
print '<input id="securitycode" placeholder="'.$langs->trans("SecurityCode").'" class="flat input-icon-security width125" type="text" maxlength="5" name="code" tabindex="3" />';
print '</span>';
print '<span class="nowrap inline-block">';
print '<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
@ -1050,7 +1050,7 @@ class FormTicket
}
// Subject
print '<tr class="email_line"><td class="titlefieldcreate">'.$langs->trans('Subject').'</td>';
print '<tr class="email_line"><td>'.$langs->trans('Subject').'</td>';
print '<td><input type="text" class="text minwidth500" name="subject" value="['.$conf->global->MAIN_INFO_SOCIETE_NOM.' - '.$langs->trans("Ticket").' '.$this->ref.'] '.$langs->trans('TicketNewMessage').'" />';
print '</td></tr>';

View File

@ -344,6 +344,9 @@ class modAdherent extends DolibarrModules
'a.email'=>"Email", 'a.birth'=>"Birthday", 'a.statut'=>"Status*", 'a.photo'=>"Photo", 'a.note_public'=>"NotePublic", 'a.note_private'=>"NotePrivate",
'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription'
);
if (!empty($conf->societe->enabled)) {
$this->import_fields_array[$r]['a.fk_soc'] = "ThirdParty";
}
// Add extra fields
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
$resql = $this->db->query($sql);
@ -355,16 +358,23 @@ class modAdherent extends DolibarrModules
}
}
// End add extra fields
$this->import_convertvalue_array[$r] = array();
if (!empty($conf->societe->enabled)) {
$this->import_convertvalue_array[$r]['a.fk_soc'] = array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty');
}
$this->import_fieldshidden_array[$r] = array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r] = array(
'a.civility'=>'code@'.MAIN_DB_PREFIX.'c_civility', 'a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type', 'a.morphy'=>'(phy|mor)',
'a.statut'=>'^[0|1]', 'a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 'a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r] = array(
'a.civility'=>"MR", 'a.lastname'=>'Smith', 'a.firstname'=>'John', 'a.login'=>'jsmith', 'a.pass'=>'passofjsmith', 'a.fk_adherent_type'=>'1',
'a.civility'=>"MR", 'a.lastname'=>'Smith', 'a.firstname'=>'John', 'a.gender'=>'man or woman', 'a.login'=>'jsmith', 'a.pass'=>'passofjsmith', 'a.fk_adherent_type'=>'1',
'a.morphy'=>'"mor" or "phy"', 'a.societe'=>'JS company', 'a.address'=>'21 jump street', 'a.zip'=>'55000', 'a.town'=>'New York', 'a.country'=>'1',
'a.email'=>'jsmith@example.com', 'a.birth'=>'1972-10-10', 'a.statut'=>"0 or 1", 'a.note_public'=>"This is a public comment on member",
'a.note_private'=>"This is private comment on member", 'a.datec'=>dol_print_date($now, '%Y-%m__%d'), 'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'), '%Y-%m-%d')
);
if (!empty($conf->societe->enabled)) {
$this->import_examplevalues_array[$r]['a.fk_soc'] = "rowid or name";
}
// Cronjobs
$arraydate = dol_getdate(dol_now());

View File

@ -501,7 +501,7 @@ class modCategorie extends DolibarrModules
'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
'cs.fk_soc'=>array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty')
);
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or ref");
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or name");
}
// 2 Customers
@ -522,7 +522,7 @@ class modCategorie extends DolibarrModules
'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'),
'cs.fk_soc'=>array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty')
);
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or ref");
$this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or name");
}
// 3 Members

View File

@ -322,7 +322,7 @@ class modUser extends DolibarrModules
'u.birth'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'
);
$this->import_examplevalues_array[$r] = array(
'u.lastname'=>"Doe", 'u.firstname'=>'John', 'u.login'=>'jdoe', 'u.employee'=>'0 or 1', 'u.job'=>'CTO', 'u.gender'=>'0 or 1',
'u.lastname'=>"Doe", 'u.firstname'=>'John', 'u.login'=>'jdoe', 'u.employee'=>'0 or 1', 'u.job'=>'CTO', 'u.gender'=>'man or woman',
'u.pass_crypted'=>'Encrypted password',
'u.fk_soc'=>'0 (internal user) or company name (external user)', 'u.datec'=>dol_print_date(dol_now(), '%Y-%m-%d'), 'u.address'=>"61 jump street",
'u.zip'=>"123456", 'u.town'=>"Big town", 'u.fk_country'=>'US, FR, DE...', 'u.office_phone'=>"0101010101", 'u.office_fax'=>"0101010102",

View File

@ -90,7 +90,7 @@ if ($permission) {
?>
<form class="tagtr liste_titre">
<div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("Users").' | '.$langs->trans("Contacts"); ?></div>
<div class="tagtd liste_titre"><?php echo img_picto($langs->trans("Users"), 'user', 'class="optiongrey paddingright"').$langs->trans("Users").' | '.img_picto($langs->trans("Contacts"), 'contact', 'class="optiongrey paddingright"').$langs->trans("Contacts"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("ContactType"); ?></div>
<div class="tagtd liste_titre">&nbsp;</div>
<div class="tagtd liste_titre">&nbsp;</div>

View File

@ -199,11 +199,13 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra]))
&& $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $tmpkeyextra)
&& empty($extrafields->attributes[$object->table_element]['computed'][$tmpkeyextra])) {
$fieldid = 'id';
$fieldid = empty($forcefieldid) ? 'id' : $forcefieldid;
$valueid = empty($forceobjectid) ? $object->id : $forceobjectid;
if ($object->table_element == 'societe') {
$fieldid = 'socid';
}
print '<td class="right"><a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?'.$fieldid.'='.$object->id.'&action=edit_extras&attribute='.$tmpkeyextra.'&ignorecollapsesetup=1">'.img_edit().'</a></td>';
print '<td class="right"><a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?'.$fieldid.'='.$valueid.'&action=edit_extras&attribute='.$tmpkeyextra.'&ignorecollapsesetup=1">'.img_edit().'</a></td>';
}
print '</tr></table>';
print '</td>';

View File

@ -212,7 +212,7 @@ if ($captcha) {
<span class="fa fa-unlock"></span>
<span class="span-icon-security inline-block">
<input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" />
<input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width125" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" />
</span>
<span class="nowrap inline-block">
<img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />

View File

@ -79,6 +79,7 @@ if (!empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE_SCREEN) && in_array($obje
$sign = -1;
}
$coldisplay = 0;
?>
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
@ -163,32 +164,33 @@ if (($line->info_bits & 2) == 2) {
// Show date range
if ($line->element == 'facturedetrec') {
if ($line->date_start_fill || $line->date_end_fill) {
print '<br><div class="clearboth nowraponall">';
print '<div class="clearboth nowraponall"><br>';
}
if ($line->date_start_fill) {
print $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill);
print '<span class="opacitymedium">'.$langs->trans('AutoFillDateFromShort').':</span> '.yn($line->date_start_fill);
}
if ($line->date_start_fill && $line->date_end_fill) {
print ' - ';
}
if ($line->date_end_fill) {
print $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill);
print '<span class="opacitymedium">'.$langs->trans('AutoFillDateToShort').':</span> '.yn($line->date_end_fill);
}
if ($line->date_start_fill || $line->date_end_fill) {
print '</div>';
}
} else {
if ($line->date_start || $line->date_end) {
print '<br><div class="clearboth nowraponall opacitymedium">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
print '<div class="clearboth nowraponall opacitymedium">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
}
//print get_date_range($line->date_start, $line->date_end, $format);
}
// Add description in form
if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) {
print (!empty($line->description) && $line->description != $line->product_label) ? '<br>'.dol_htmlentitiesbr($line->description) : '';
print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start || $line->date_end) ? '' : '<br>').'<br>'.dol_htmlentitiesbr($line->description) : '';
}
//Line extrafield
// Line extrafield
if (!empty($extrafields)) {
$temps = $line->showOptionals($extrafields, 'view', array(), '', '', 1, 'line');
if (!empty($temps)) {

View File

@ -150,7 +150,7 @@ if (!empty($captcha)) {
<span class="fa fa-unlock"></span>
<span class="nofa inline-block">
<input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" />
<input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width125" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" />
</span>
<span class="nowrap inline-block">
<img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />

View File

@ -242,11 +242,11 @@ class ConferenceOrBooth extends ActionComm
*/
public function fetch($id, $ref = null, $ref_ext = '', $email_msgid = '')
{
global $dolibarr_main_url_root, $dolibarr_main_instance_unique_id, $conf, $langs;
global $dolibarr_main_url_root, $conf, $langs;
$result = parent::fetch($id, $ref, $ref_ext, $email_msgid);
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$id;
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.urlencode($id);
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);

View File

@ -33,13 +33,13 @@ if ($conf->categorie->enabled) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
global $dolibarr_main_url_root;
// for other modules
//dol_include_once('/othermodule/class/otherobject.class.php');
// Load translation files required by the page
$langs->loadLangs(array("eventorganization", "other"));
global $dolibarr_main_url_root, $dolibarr_main_instance_unique_id;
$langs->loadLangs(array("eventorganization", "other", "projects"));
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
@ -228,7 +228,7 @@ $now = dol_now();
//$help_url="EN:Module_ConferenceOrBooth|FR:Module_ConferenceOrBooth_FR|ES:Módulo_ConferenceOrBooth";
$help_url = '';
$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("ConferenceOrBooths"));
$title = $langs->trans('ListOfConferencesOrBooths');
if ($projectid > 0) {
$project = new Project($db);
@ -246,9 +246,9 @@ if ($projectid > 0) {
}
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos";
$title = $langs->trans("Project") . ' - ' . $langs->trans("ConferenceOrBooths") . ' - ' . $project->ref . ' ' . $project->name;
$title = $langs->trans("Project") . ' - ' . $langs->trans("ListOfConferencesOrBooths") . ' - ' . $project->ref . ' ' . $project->name;
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $project->name) {
$title = $project->ref . ' ' . $project->name . ' - ' . $langs->trans("ConferenceOrBooths");
$title = $project->ref . ' ' . $project->name . ' - ' . $langs->trans("ListOfConferencesOrBooths");
}
}
@ -352,14 +352,6 @@ if ($projectid > 0) {
}
print '</td></tr>';
// Link to the vote/register page
print '<tr><td>'.$langs->trans("RegisterPage").'</td><td>';
$linkregister = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id;
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2);
$linkregister .= '&securekey='.urlencode($encodedsecurekey);
print '<a target="_blank" href="'.$linkregister.'">'.$linkregister.'</a>';
print '</td></tr>';
// Other attributes
$cols = 2;
$objectconf=$object;
@ -422,12 +414,45 @@ if ($projectid > 0) {
$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=".$projectid.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
$message .= "&project=".$projectid.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
print $message;
print "</td></tr>";
// Link to the submit vote/register page
print '<tr><td>';
//print '<span class="opacitymedium">';
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, 2);
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$linksuggest.'" class="quatrevingtpercent">'.$linksuggest.'</a></div>';
print '<a target="_blank" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
//print '</div>';
//print ajax_autoselect("linkregister");
print '</td></tr>';
// Link to the subscribe
print '<tr><td>';
//print '<span class="opacitymedium">';
print $langs->trans("PublicAttendeeSubscriptionPage");
//print '</span>';
print '</td><td>';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$project->id;
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2);
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.'" class="quatrevingtpercent">'.$link_subscription.'</a></div>';
print '<a target="_blank" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
//print '</div>';
//print ajax_autoselect("linkregister");
print '</td></tr>';
print '</table>';
@ -437,7 +462,6 @@ if ($projectid > 0) {
print '<div class="clearboth"></div>';
print dol_get_fiche_end();
}
@ -612,7 +636,7 @@ $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle'
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
// Add code for pre mass action (confirmation or email presend form)
$topicmail = "SendConferenceOrBoothRef";
$topicmail = $object->ref;
$modelmail = "conferenceorbooth";
$objecttmp = new ConferenceOrBooth($db);
$trackid = 'conferenceorbooth_'.$object->id;
@ -665,7 +689,7 @@ foreach ($object->fields as $key => $val) {
$cssforfield .= ($cssforfield ? ' ' : '').'center';
} elseif (in_array($val['type'], array('timestamp'))) {
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref')) && $val['label'] != 'TechnicalID') {
$cssforfield .= ($cssforfield ? ' ' : '').'right';
}
if (!empty($arrayfields['t.'.$key]['checked'])) {
@ -713,7 +737,7 @@ foreach ($object->fields as $key => $val) {
$cssforfield .= ($cssforfield ? ' ' : '').'center';
} elseif (in_array($val['type'], array('timestamp'))) {
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref')) && $val['label'] != 'TechnicalID') {
$cssforfield .= ($cssforfield ? ' ' : '').'right';
}
if (!empty($arrayfields['t.'.$key]['checked'])) {
@ -768,10 +792,10 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
if (in_array($val['type'], array('timestamp'))) {
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
} elseif ($key == 'ref') {
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap left';
}
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status'))) {
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref', 'status'))) {
$cssforfield .= ($cssforfield ? ' ' : '').'right';
}
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';

View File

@ -379,7 +379,11 @@ if (empty($reshook)) {
}
}
} else {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("QtyToShip").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip");
if (!empty($conf->stock->enabled)) {
$labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse");
}
setEventMessages($langs->trans("ErrorFieldRequired", $labelfieldmissing), null, 'errors');
$error++;
}
@ -717,6 +721,16 @@ if (empty($reshook)) {
unset($_POST[$qty]);
}
}
} elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
$qty = "qtyl".$line_id;
$line->id = $line_id;
$line->qty = GETPOST($qty, 'int');
$line->entrepot_id = 0;
if ($line->update($user) < 0) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
}
unset($_POST[$qty]);
}
} else {
// Product no predefined
@ -786,6 +800,10 @@ $help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:M&oacute;dulo_Expedic
llxHeader('', $langs->trans('Shipment'), 'Expedition', $help_url);
if (empty($action)) {
$action = 'view';
}
$form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
@ -997,9 +1015,9 @@ if ($action == 'create') {
$numAsked = count($object->lines);
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#autofill").click(function() {';
print '<script type="text/javascript" language="javascript">'."\n";
print 'jQuery(document).ready(function() {'."\n";
print 'jQuery("#autofill").click(function() {';
$i = 0;
while ($i < $numAsked) {
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
@ -1008,10 +1026,11 @@ if ($action == 'create') {
}
$i++;
}
print '});
jQuery("#autoreset").click(function() { console.log("Reset values to 0"); jQuery(".qtyl").val(0); });
});
</script>';
print 'return false; });'."\n";
print 'jQuery("#autoreset").click(function() { console.log("Reset values to 0"); jQuery(".qtyl").val(0);'."\n";
print 'return false; });'."\n";
print '});'."\n";
print '</script>'."\n";
print '<br>';
@ -1172,7 +1191,7 @@ if ($action == 'create') {
$deliverableQty = GETPOST('qtyl'.$indiceAsked, 'int');
}
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="text" size="4" value="'.$deliverableQty.'">';
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl center" type="text" size="4" value="'.$deliverableQty.'">';
} else {
print $langs->trans("NA");
}
@ -2189,7 +2208,7 @@ if ($action == 'create') {
if ($action == 'editline' && $lines[$i]->id == $line_id) {
// edit mode
print '<td colspan="'.$editColspan.'" class="center"><table class="nobordernopadding">';
print '<td colspan="'.$editColspan.'" class="center"><table class="nobordernopadding centpercent">';
if (is_array($lines[$i]->detail_batch) && count($lines[$i]->detail_batch) > 0) {
print '<!-- case edit 1 -->';
$line = new ExpeditionLigne($db);
@ -2252,6 +2271,16 @@ if ($action == 'create') {
print '<td></td>';
print '</tr>';
}
} elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
print '<!-- case edit 6 -->';
print '<tr>';
// Qty to ship or shipped
print '<td><input class="qtyl" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'"></td>';
// Warehouse source
print '<td></td>';
// Batch number managment
print '<td></td>';
print '</tr>';
}
print '</table></td>';
@ -2369,10 +2398,11 @@ if ($action == 'create') {
$line = $lines[$i];
$line->fetch_optionals();
// TODO Show all in same line by setting $display_type = 'line'
if ($action == 'editline' && $line->id == $line_id) {
print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked);
print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked, '', 0, 'card');
} else {
print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked);
print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked, '', 0, 'card');
}
}
}

View File

@ -3387,20 +3387,11 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->multicurrency_total_ttc = 0;
}
$fk_product = (int) $this->fk_product;
$fk_unit = (int) $this->fk_unit;
$this->db->begin();
if (empty($this->fk_product)) {
$fk_product = "null";
} else {
$fk_product = $this->fk_product;
}
if (empty($this->fk_unit)) {
$fk_unit = "null";
} else {
$fk_unit = "'".$this->db->escape($this->fk_unit)."'";
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
$sql .= " description ='".$this->db->escape($this->description)."'";
$sql .= ", ref ='".$this->db->escape($this->ref_supplier ? $this->ref_supplier : $this->ref)."'";
@ -3410,7 +3401,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql .= ", pu_ttc = ".price2num($this->pu_ttc);
$sql .= ", qty = ".price2num($this->qty);
$sql .= ", remise_percent = ".price2num($this->remise_percent);
if ($this->fk_remise_except) $sql .= ", fk_remise_except=".((int) $this->fk_remise_except);
if ($this->fk_remise_except > 0) $sql .= ", fk_remise_except=".((int) $this->fk_remise_except);
else $sql .= ", fk_remise_except=null";
$sql .= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'";
$sql .= ", tva_tx = ".price2num($this->tva_tx);
@ -3423,7 +3414,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql .= ", total_localtax1= ".price2num($this->total_localtax1);
$sql .= ", total_localtax2= ".price2num($this->total_localtax2);
$sql .= ", total_ttc = ".price2num($this->total_ttc);
$sql .= ", fk_product = ".((int) $fk_product);
$sql .= ", fk_product = ".($fk_product > 0 ? (int) $fk_product : 'null');
$sql .= ", product_type = ".((int) $this->product_type);
$sql .= ", info_bits = ".((int) $this->info_bits);
$sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null');

View File

@ -459,7 +459,7 @@ CREATE TABLE llx_partnership(
fk_soc integer,
fk_member integer,
date_partnership_start date NOT NULL,
date_partnership_end date NOT NULL,
date_partnership_end date NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id, 0 = all
reason_decline_or_cancel text NULL,
date_creation datetime NOT NULL,

View File

@ -570,7 +570,7 @@ ToCreateARecurringInvoiceGene=To generate future invoices regularly and manually
ToCreateARecurringInvoiceGeneAuto=If you need to have such invoices generated automatically, ask your administrator to enable and setup module <strong>%s</strong>. Note that both methods (manual and automatic) can be used together with no risk of duplication.
DeleteRepeatableInvoice=Delete template invoice
ConfirmDeleteRepeatableInvoice=Are your sure you want to delete the template invoice?
CreateOneBillByThird=Create one invoice per third party (otherwise, one invoice per order)
CreateOneBillByThird=Create one invoice per third party (otherwise, one invoice per selected object)
BillCreated=%s invoice(s) generated
BillXCreated=Invoice %s generated
StatusOfGeneratedDocuments=Status of document generation

View File

@ -100,16 +100,17 @@ EvntOrgCancelled = Cancelled
# Public page
#
SuggestForm = Suggestion page
RegisterPage = Page for conferences or booth
SuggestOrVoteForConfOrBooth = Page for suggestion or vote
EvntOrgRegistrationHelpMessage = Here, you can vote for an event, or suggest a new conference or booth for the project
EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project
EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project
ListOfSuggestedConferences = List of suggested conferences
ListOfSuggestedBooths = List of suggested booths
ListOfConferencesOrBooths=List of conferences or booths
SuggestConference = Suggest a new conference
SuggestBooth = Suggest a booth
ViewAndVote = View and vote for suggested events
PublicAttendeeSubscriptionPage = Public link of registration to a conference
PublicAttendeeSubscriptionPage = Public link for registration to the event
MissingOrBadSecureKey = The security key is invalid or missing
EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference : '%s'
EvntOrgDuration = This conference starts on %s and ends on %s.
@ -122,6 +123,8 @@ ConferenceIsNotConfirmed=Subcription not available, conference is not confirmed
DateMustBeBeforeThan=%s must be before %s
DateMustBeAfterThan=%s must be after %s
NewSubscription=Registration
#
# Vote page
#

View File

@ -96,8 +96,8 @@ DataComeFromFileFieldNb=Value to insert comes from field number <b>%s</b> in sou
DataComeFromIdFoundFromRef=Value that comes from field number <b>%s</b> of source file will be used to find the id of the parent object to use (so the object <b>%s</b> that has the ref. from source file must exist in the database).
DataComeFromIdFoundFromCodeId=Code that comes from field number <b>%s</b> of source file will be used to find the id of the parent object to use (so the code from source file must exist in the dictionary <b>%s</b>). Note that if you know the id, you can also use it in the source file instead of the code. Import should work in both cases.
DataIsInsertedInto=Data coming from source file will be inserted into the following field:
DataIDSourceIsInsertedInto=The id of parent object was found using the data in the source file, will be inserted into the following field:
DataCodeIDSourceIsInsertedInto=The id of parent line found from code, will be inserted into following field:
DataIDSourceIsInsertedInto=The id of the parent object, that was found using the data in the source file, will be inserted into the following field:
DataCodeIDSourceIsInsertedInto=The id of the parent line, that was found from code, will be inserted into the following field:
SourceRequired=Data value is mandatory
SourceExample=Example of possible data value
ExampleAnyRefFoundIntoElement=Any ref found for element <b>%s</b>

View File

@ -155,7 +155,7 @@ DescADHERENT_CARD_TEXT_RIGHT=Text printed on member cards (align on right)
DescADHERENT_CARD_FOOTER_TEXT=Text printed on bottom of member cards
ShowTypeCard=Show type '%s'
HTPasswordExport=htpassword file generation
NoThirdPartyAssociatedToMember=No third party associated to this member
NoThirdPartyAssociatedToMember=No third party associated with this member
MembersAndSubscriptions= Members and Subscriptions
MoreActions=Complementary action on recording
MoreActionsOnSubscription=Complementary action, suggested by default when recording a subscription

View File

@ -151,6 +151,7 @@ PDFEdisonDescription=A simple order model
PDFProformaDescription=A complete Proforma invoice template
CreateInvoiceForThisCustomer=Bill orders
CreateInvoiceForThisSupplier=Bill orders
CreateInvoiceForThisReceptions=Bill receptions
NoOrdersToInvoice=No orders billable
CloseProcessedOrdersAutomatically=Classify "Processed" all selected orders.
OrderCreation=Order creation

View File

@ -62,8 +62,8 @@ ListOfUsersInGroup=List of users in this group
ListOfGroupsForUser=List of groups for this user
LinkToCompanyContact=Link to third party / contact
LinkedToDolibarrMember=Link to member
LinkedToDolibarrUser=Link to Dolibarr user
LinkedToDolibarrThirdParty=Link to Dolibarr third party
LinkedToDolibarrUser=Link to user
LinkedToDolibarrThirdParty=Link to third party
CreateDolibarrLogin=Create a user
CreateDolibarrThirdParty=Create a third party
LoginAccountDisableInDolibarr=Account disabled in Dolibarr.

View File

@ -383,7 +383,7 @@ if ($dirins && $action == 'initphpunit' && !empty($module)) {
$modulename = ucfirst($module); // Force first letter in uppercase
$objectname = $tabobj;
dol_mkdir($dirins.'/'.strtolower($module).'/class');
dol_mkdir($dirins.'/'.strtolower($module).'/test/phpunit');
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
$srcfile = $srcdir.'/test/phpunit/MyObjectTest.php';
$destfile = $dirins.'/'.strtolower($module).'/test/phpunit/'.strtolower($objectname).'Test.php';
@ -2218,7 +2218,8 @@ if ($module == 'initmodule') {
if ($action != 'editfile' || empty($file)) {
print '<span class="opacitymedium">';
$htmlhelp = $langs->trans("DictionariesDefDescTooltip", '<a href="'.DOL_URL_ROOT.'/admin/dict.php">'.$langs->trans('Setup').' - '.$langs->trans('Dictionaries').'</a>');
$htmlhelp = $langs->trans("DictionariesDefDescTooltip", '{s1}');
$htmlhelp = str_replace('{s1}', '<a target="adminbis" class="nofocusvisible" href="'.DOL_URL_ROOT.'/admin/dict.php">'.$langs->trans('Setup').' - '.$langs->trans('Dictionaries').'</a>', $htmlhelp);
print $form->textwithpicto($langs->trans("DictionariesDefDesc"), $htmlhelp, 1, 'help', '', 0, 2, 'helpondesc').'<br>';
print '</span>';
print '<br>';
@ -3002,7 +3003,8 @@ if ($module == 'initmodule') {
if ($action != 'editfile' || empty($file)) {
print '<span class="opacitymedium">';
$htmlhelp = $langs->trans("MenusDefDescTooltip", '<a href="'.DOL_URL_ROOT.'/admin/menus/index.php">'.$langs->trans('Setup').' - '.$langs->trans('Menus').'</a>');
$htmlhelp = $langs->trans("MenusDefDescTooltip", '{s1}');
$htmlhelp = str_replace('{s1}', '<a target="adminbis" class="nofocusvisible" href="'.DOL_URL_ROOT.'/admin/menus/index.php">'.$langs->trans('Setup').' - '.$langs->trans('Menus').'</a>', $htmlhelp);
print $form->textwithpicto($langs->trans("MenusDefDesc"), $htmlhelp, 1, 'help', '', 0, 2, 'helpondesc').'<br>';
print '</span>';
print '<br>';
@ -3134,7 +3136,8 @@ if ($module == 'initmodule') {
if ($action != 'editfile' || empty($file)) {
print '<span class="opacitymedium">';
$htmlhelp = $langs->trans("PermissionsDefDescTooltip", '<a href="'.DOL_URL_ROOT.'/admin/perms.php">'.$langs->trans('DefaultPermissions').'</a>');
$htmlhelp = $langs->trans("PermissionsDefDescTooltip", '{s1}');
$htmlhelp = str_replace('{s1}', '<a target="adminbis" class="nofocusvisible" href="'.DOL_URL_ROOT.'/admin/perms.php">'.$langs->trans('DefaultRights').'</a>', $htmlhelp);
print $form->textwithpicto($langs->trans("PermissionsDefDesc"), $htmlhelp, 1, 'help', '', 0, 2, 'helpondesc').'<br>';
print '</span>';
print '<br>';
@ -3601,7 +3604,7 @@ if ($module == 'initmodule') {
$cronjobs = $moduleobj->cronjobs;
if ($action != 'editfile' || empty($file)) {
print '<span class="opacitymedium">'.str_replace('{s1}', '<a href="'.DOL_URL_ROOT.'/cron/list.php">'.$langs->transnoentities('CronList').'</a>', $langs->trans("CronJobDefDesc", '{s1}')).'</span><br>';
print '<span class="opacitymedium">'.str_replace('{s1}', '<a target="adminbis" class="nofocusvisible" href="'.DOL_URL_ROOT.'/cron/list.php">'.$langs->transnoentities('CronList').'</a>', $langs->trans("CronJobDefDesc", '{s1}')).'</span><br>';
print '<br>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';

View File

@ -69,7 +69,7 @@ class MyModuleApi extends DolibarrApi
*/
public function get($id)
{
if (!DolibarrApiAccess::$user->rights->mymodule->read) {
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->read) {
throw new RestException(401);
}
@ -205,7 +205,7 @@ class MyModuleApi extends DolibarrApi
*/
public function post($request_data = null)
{
if (!DolibarrApiAccess::$user->rights->mymodule->write) {
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->write) {
throw new RestException(401);
}
@ -238,7 +238,7 @@ class MyModuleApi extends DolibarrApi
*/
public function put($id, $request_data = null)
{
if (!DolibarrApiAccess::$user->rights->mymodule->write) {
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->write) {
throw new RestException(401);
}
@ -280,7 +280,7 @@ class MyModuleApi extends DolibarrApi
*/
public function delete($id)
{
if (!DolibarrApiAccess::$user->rights->mymodule->delete) {
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->delete) {
throw new RestException(401);
}
$result = $this->myobject->fetch($id);

View File

@ -65,8 +65,10 @@ if ($action == 'setting') {
$error += $partnership->delete_menus();
$error += $partnership->insert_menus();
if (GETPOST("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL", 'int'))
if (GETPOSTISSET("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL")) {
dolibarr_set_const($db, "PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL", GETPOST("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL", 'int'), 'chaine', 0, '', $conf->entity);
}
dolibarr_set_const($db, "PARTNERSHIP_BACKLINKS_TO_CHECK", GETPOST("PARTNERSHIP_BACKLINKS_TO_CHECK"), 'chaine', 0, '', $conf->entity);
}
@ -131,16 +133,16 @@ print '<td><span class="opacitymedium">'.$langs->trans("partnershipforthirdparty
print '</tr>';
if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') {
print '<tr class="oddeven"><td>'.$langs->trans("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL").'</td>';
print '<td>';
$dnbdays = '15';
$backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays;
print '<input class="maxwidth50" type="text" name="PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL" value="'.$backlinks.'">';
print '</td>';
print '<td><span class="opacitymedium">'.$dnbdays.'</span></td>';
print '</tr>';
}
//if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') {
print '<tr class="oddeven"><td>'.$langs->trans("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL").'</td>';
print '<td>';
$dnbdays = '30';
$backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays;
print '<input class="maxwidth50" type="text" name="PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL" value="'.$backlinks.'">';
print '</td>';
print '<td><span class="opacitymedium">'.$dnbdays.'</span></td>';
print '</tr>';
//}
print '</table>';
print '</div>';

View File

@ -1647,7 +1647,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
}
print '<td class="right">';
if ($candelete || ($db->jdate($objp->dp) >= dol_now())) { // Test on date is to be able to delete a corrupted record with a date in future
if ($candelete || ($db->jdate($objp->dp) >= dol_now())) { // Test on date is to be able to delete a corrupted record with a date in future
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&amp;token='.newToken().'&amp;id='.$object->id.'&amp;lineid='.$objp->rowid.'">';
print img_delete();
print '</a>';

View File

@ -564,9 +564,9 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '<br>';
}
if (!empty($conf->eventorganization->enabled)) {
print '<input type="checkbox" name="usage_organize_event"'.(GETPOST('usage_organize_event', 'alpha')!=''?' checked="checked"':'').'"> ';
print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOST('usage_organize_event', 'alpha')!=''?' checked="checked"':'').'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
print '<label for="usage_organize_event">'.$form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext).'</label>';
}
print '</td>';
print '</tr>';
@ -830,7 +830,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print '<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_opportunity ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("ProjectFollowOpportunity");
print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
print '<label for="usage_opportunity">'.$form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext).'</label>';
print '<script>';
print '$( document ).ready(function() {
jQuery("#usage_opportunity").change(function() {
@ -847,21 +847,21 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
print '<input type="checkbox" name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')) . '"> ';
print '<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')) . '"> ';
$htmltext = $langs->trans("ProjectFollowTasks");
print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
print '<label for="usage_task">'.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).'</label>';
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
print '<input type="checkbox" name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')) . '"> ';
print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')) . '"> ';
$htmltext = $langs->trans("ProjectBillTimeDescription");
print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
print '<label for="usage_bill_time">'.$form->textwithpicto($langs->trans("BillTime"), $htmltext).'</label>';
print '<br>';
}
if (!empty($conf->eventorganization->enabled)) {
print '<input type="checkbox" name="usage_organize_event"'. (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')) . '"> ';
print '<input type="checkbox" id="usage_organize_event" 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 '<label for="usage_organize_event">'.$form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext).'</label>';
}
print '</td></tr>';
}

View File

@ -16,9 +16,9 @@
*/
/**
* \file htdocs/public/members/new.php
* \ingroup member
* \brief Example of form to add a new member
* \file htdocs/public/eventorganization/attendee_subscription.php
* \ingroup project
* \brief Example of form to subscribe to an event
*
* Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
@ -79,12 +79,13 @@ $email = GETPOST("email");
$societe = GETPOST("societe");
// Getting id from Post and decoding it
$id = GETPOST('id');
$id = GETPOST('id', 'int');
$conference = new ConferenceOrBooth($db);
$resultconf = $conference->fetch($id);
if ($resultconf < 0) {
setEventMessages(null, $conference->errors, "errors");
print 'Bad value for parameter id';
exit;
}
$project = new Project($db);
@ -196,7 +197,7 @@ function llxFooterVierge()
/*
* Actions
*/
global $mysoc;
$parameters = array();
// Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
@ -205,7 +206,7 @@ if ($reshook < 0) {
}
// Action called when page is submitted
if (empty($reshook) && $action == 'add' && $conference->status==2) {
if (empty($reshook) && $action == 'add' && $conference->status == 2) {
$error = 0;
$urlback = '';
@ -460,7 +461,7 @@ $formcompany = new FormCompany($db);
llxHeaderVierge($langs->trans("NewSubscription"));
print '<br>';
print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center');
@ -473,6 +474,9 @@ print $langs->trans("EvntOrgWelcomeMessage", $conference->label);
print '<br>';
print $langs->trans("EvntOrgDuration", dol_print_date($conference->datep), dol_print_date($conference->datef));
print '</div>';
print '<br>';
dol_htmloutput_errors($errmsg);
if ($conference->status!=2) {

View File

@ -1516,7 +1516,7 @@ if ($source == 'member' || $source == 'membersubscription') {
$oldtypeid = $member->typeid;
$newtypeid = (int) (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid);
if ($oldtypeid != $newtypeid && !empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE)) {
if (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE)) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$adht = new AdherentType($db);
// Amount by member type

View File

@ -195,7 +195,7 @@ if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) {
print '<table id="dolpaymenttable" summary="Payment form" class="center">'."\n";
$text = '<tr><td class="textpublicpayment"><br><strong>'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'</strong></td></tr>'."\n";
$text .= '<tr><td class="textpublicpayment">'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.<br><br></td></tr>'."\n";
$text .= '<tr><td class="textpublicpayment">'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$project->title.'.<br><br></td></tr>'."\n";
$text .= '<tr><td class="textpublicpayment">'.$project->note_public.'<br><br></td></tr>'."\n";;
print $text;

View File

@ -171,87 +171,102 @@ if (empty($reshook)) {
$createbills_onebythird = GETPOST('createbills_onebythird', 'int');
$validate_invoices = GETPOST('validate_invoices', 'int');
$errors = array();
$TFact = array();
$TFactThird = array();
$nb_bills_created = 0;
$lastid= 0;
$lastref = '';
$db->begin();
$errors = array();
foreach ($receptions as $id_reception) {
$rcp = new Reception($db);
// On ne facture que les réceptions validées
if ($rcp->fetch($id_reception) <= 0 || $rcp->statut != 1) {
// We only invoice reception that are validated
if ($rcp->fetch($id_reception) <= 0 || $rcp->statut != $rcp::STATUS_VALIDATED) {
$errors[] = $langs->trans('StatusOfRefMustBe', $rcp->ref, $langs->transnoentities("StatusSupplierOrderValidatedShort"));
$error++;
continue;
}
$object = new FactureFournisseur($db);
$objecttmp = new FactureFournisseur($db);
if (!empty($createbills_onebythird) && !empty($TFactThird[$rcp->socid])) {
$object = $TFactThird[$rcp->socid]; // If option "one bill per third" is set, we use already created reception.
if (empty($object->rowid) && $object->id != null) {
$object->rowid = $object->id;
}
if (!empty($object->rowid)) {
$object->fetchObjectLinked();
}
$rcp->fetchObjectLinked();
// If option "one bill per third" is set, and an invoice for this thirdparty was already created, we re-use it.
$objecttmp = $TFactThird[$rcp->socid];
if (count($rcp->linkedObjectsIds['reception']) > 0) {
foreach ($rcp->linkedObjectsIds['reception'] as $key => $value) {
if (empty($object->linkedObjectsIds['reception']) || !in_array($value, $object->linkedObjectsIds['reception'])) { //Dont try to link if already linked
$object->add_object_linked('reception', $value); // add supplier order linked object
// Add all links of this new reception to the existing invoice
$objecttmp->fetchObjectLinked();
$rcp->fetchObjectLinked();
if (count($rcp->linkedObjectsIds['order_supplier']) > 0) {
foreach ($rcp->linkedObjectsIds['order_supplier'] as $key => $value) {
if (empty($objecttmp->linkedObjectsIds['order_supplier']) || !in_array($value, $objecttmp->linkedObjectsIds['order_supplier'])) { //Dont try to link if already linked
$objecttmp->add_object_linked('order_supplier', $value); // add supplier order linked object
}
}
}
} else {
$object->socid = $rcp->socid;
$object->type = FactureFournisseur::TYPE_STANDARD;
$object->cond_reglement_id = $rcp->thirdparty->cond_reglement_supplier_id;
$object->mode_reglement_id = $rcp->thirdparty->mode_reglement_supplier_id;
$object->fk_account = !empty($rcp->thirdparty->fk_account) ? $rcp->thirdparty->fk_account : 0;
$object->remise_percent = !empty($rcp->thirdparty->remise_percent) ? $rcp->thirdparty->remise_percent : 0;
$object->remise_absolue = !empty($rcp->thirdparty->remise_absolue) ? $rcp->thirdparty->remise_absolue : 0;
// If we want one invoice per reception or if there is no first invoice yet for this thirdparty.
$objecttmp->socid = $rcp->socid;
$objecttmp->type = $objecttmp::TYPE_STANDARD;
$objecttmp->cond_reglement_id = $rcp->cond_reglement_id || $rcp->thirdparty->cond_reglement_supplier_id;
$objecttmp->mode_reglement_id = $rcp->mode_reglement_id || $rcp->thirdparty->mode_reglement_supplier_id;
$object->fk_project = $rcp->fk_project;
$object->ref_supplier = $rcp->ref_supplier;
$objecttmp->fk_account = !empty($rcp->thirdparty->fk_account) ? $rcp->thirdparty->fk_account : 0;
$objecttmp->remise_percent = !empty($rcp->thirdparty->remise_percent) ? $rcp->thirdparty->remise_percent : 0;
$objecttmp->remise_absolue = !empty($rcp->thirdparty->remise_absolue) ? $rcp->thirdparty->remise_absolue : 0;
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
if (empty($datefacture)) {
$datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
$objecttmp->fk_project = $rcp->fk_project;
//$objecttmp->multicurrency_code = $rcp->multicurrency_code;
if (empty($createbills_onebythird)) {
$objecttmp->ref_supplier = $rcp->ref;
} else {
// Set a unique value for the invoice for the n reception
$objecttmp->ref_supplier = $langs->trans("Reception").' '.dol_print_date(dol_now(), 'dayhourlog').'-'.$rcp->socid;
}
$object->date = $datefacture;
$object->origin = 'reception';
$object->origin_id = $id_reception;
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
if (empty($datefacture)) {
$datefacture = dol_now();
}
$objecttmp->date = $datefacture;
$objecttmp->origin = 'reception';
$objecttmp->origin_id = $id_reception;
$objecttmp->array_options = $rcp->array_options; // Copy extrafields
// Set $objecttmp->linked_objects with all links order_supplier existing on reception, so same links will be added to the generated supplier invoice
$rcp->fetchObjectLinked();
if (count($rcp->linkedObjectsIds['reception']) > 0) {
foreach ($rcp->linkedObjectsIds['reception'] as $key => $value) {
$object->linked_objects['reception'] = $value;
if (count($rcp->linkedObjectsIds['order_supplier']) > 0) {
foreach ($rcp->linkedObjectsIds['order_supplier'] as $key => $value) {
$objecttmp->linked_objects['order_supplier'] = $value;
}
}
$res = $object->create($user);
//var_dump($object->error);exit;
$res = $objecttmp->create($user); // This should create the supplier invoice + links into $objecttmp->linked_objects + add a link to ->origin_id
//var_dump($objecttmp->error);exit;
if ($res > 0) {
$nb_bills_created++;
$object->id = $res;
$lastref = $objecttmp->ref;
$lastid = $objecttmp->id;
$TFactThird[$rcp->socid] = $objecttmp;
} else {
$errors[] = $rcp->ref.' : '.$langs->trans($object->error);
$langs->load("errors");
$errors[] = $rcp->ref.' : '.$langs->trans($objecttmp->error);
$error++;
}
}
if ($object->id > 0) {
if (!empty($createbills_onebythird) && !empty($TFactThird[$rcp->socid])) { //cause function create already add object linked for facturefournisseur
$res = $object->add_object_linked($object->origin, $id_reception);
if ($objecttmp->id > 0) {
$res = $objecttmp->add_object_linked($objecttmp->origin, $id_reception);
if ($res == 0) {
$errors[] = $object->error;
$error++;
}
if ($res == 0) {
$errors[] = $objecttmp->error;
$error++;
}
if (!$error) {
@ -266,10 +281,15 @@ if (empty($reshook)) {
for ($i = 0; $i < $num; $i++) {
$desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle);
// If we build one invoice for several reception, we must put the ref of reception on the invoice line
if (!empty($createbills_onebythird)) {
$desc = dol_concatdesc($desc, $langs->trans("Reception").' '.$rcp->ref.' - '.dol_print_date($rcp->date, 'day'));
}
if ($lines[$i]->subprice < 0) {
// Negative line, we create a discount line
$discount = new DiscountAbsolute($db);
$discount->fk_soc = $object->socid;
$discount->fk_soc = $objecttmp->socid;
$discount->amount_ht = abs($lines[$i]->total_ht);
$discount->amount_tva = abs($lines[$i]->total_tva);
$discount->amount_ttc = abs($lines[$i]->total_ttc);
@ -278,7 +298,7 @@ if (empty($reshook)) {
$discount->description = $desc;
$discountid = $discount->create($user);
if ($discountid > 0) {
$result = $object->insert_discount($discountid);
$result = $objecttmp->insert_discount($discountid);
//$result=$discount->link_to_invoice($lineid,$id);
} else {
setEventMessages($discount->error, $discount->errors, 'errors');
@ -314,7 +334,16 @@ if (empty($reshook)) {
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
$fk_parent_line = 0;
}
$result = $object->addline(
// Extrafields
if (method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options;
}
$objecttmp->context['createfromclone'];
$result = $objecttmp->addline(
$desc,
$lines[$i]->subprice,
$lines[$i]->tva_tx,
@ -359,9 +388,9 @@ if (empty($reshook)) {
//$rcp->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module.
if (!empty($createbills_onebythird) && empty($TFactThird[$rcp->socid])) {
$TFactThird[$rcp->socid] = $object;
$TFactThird[$rcp->socid] = $objecttmp;
} else {
$TFact[$object->id] = $object;
$TFact[$objecttmp->id] = $objecttmp;
}
}
@ -371,21 +400,27 @@ if (empty($reshook)) {
if (!$error && $validate_invoices) {
$massaction = $action = 'builddoc';
foreach ($TAllFact as &$object) {
$result = $object->validate($user);
foreach ($TAllFact as &$objecttmp) {
$result = $objecttmp->validate($user);
if ($result <= 0) {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
break;
}
$id = $object->id; // For builddoc action
$id = $objecttmp->id; // For builddoc action
$object =$objecttmp;
// Fac builddoc
$donotredirect = 1;
$upload_dir = $conf->fournisseur->facture->dir_output;
$permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
// Call action to build doc
$savobject = $object;
$object = $objecttmp;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
$object = $savobject;
}
$massaction = $action = 'confirm_createbills';
@ -393,9 +428,17 @@ if (empty($reshook)) {
if (!$error) {
$db->commit();
setEventMessage($langs->trans('BillCreated', $nb_bills_created));
if ($nb_bills_created == 1) {
$texttoshow = $langs->trans('BillXCreated', '{s1}');
$texttoshow = str_replace('{s1}', '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?id='.urlencode($lastid).'">'.$lastref.'</a>', $texttoshow);
setEventMessages($texttoshow, null, 'mesgs');
} else {
setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs');
}
} else {
$db->rollback();
$action = 'create';
$_GET["origin"] = $_POST["origin"];
$_GET["originid"] = $_POST["originid"];
@ -597,7 +640,7 @@ $arrayofmassactions = array(
);
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
$arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier");
$arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisReceptions");
}
if ($massaction == 'createbills') {
$arrayofmassactions = array();
@ -656,7 +699,7 @@ if ($massaction == 'createbills') {
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisSupplier').'"> ';
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisReceptions').'"> ';
print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '<br>';

View File

@ -281,6 +281,8 @@ $form = new Form($db);
$pagetitle = $langs->trans('ResourceElementPage');
llxHeader('', $pagetitle, '');
$now = dol_now();
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
// Load available resource, declared by modules
$ret = count($object->available_resources);

View File

@ -454,7 +454,7 @@ $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.address, s.tow
$sql .= " s.entity,";
$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
$sql .= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,";
$sql .= " s.tms as date_update, s.datec as date_creation,";
$sql .= " s.tms as date_update, s.datec as date_creation, s.import_key,";
$sql .= " s.code_compta, s.code_compta_fournisseur, s.parent as fk_parent,s.price_level,";
$sql .= " s2.nom as name2,";
$sql .= " typent.code as typent_code,";

View File

@ -245,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$socid = $object->id;
// TODO Replace this card with the list of all partnerships.
// TODO Replace this card with a table of list of all partnerships.
$object = new Partnership($db);
$partnershipid = $object->fetch(0, '', 0, $socid);
@ -257,10 +257,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<table class="border centpercent tableforfield">'."\n";
// Common attributes
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_member']); // Hide field already shown in banner
unset($object->fields['fk_soc']); // Hide field already shown in banner
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
$forcefieldid = 'socid';
$forceobjectid = $object->fk_soc;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>';
print '</div>';

View File

@ -295,6 +295,10 @@ input.buttonpayment, button.buttonpayment, div.buttonpayment {
cursor: pointer;
max-width: 350px;
}
.nofocusvisible:focus-visible {
outline: none;
}
div.buttonpayment input:focus {
color: #008;
}

View File

@ -473,6 +473,10 @@ input.buttonpayment, button.buttonpayment, div.buttonpayment {
white-space: normal;
color: #888 !important;
}
.nofocusvisible:focus-visible {
outline: none;
}
div.buttonpayment input {
background-color: unset;
border-bottom: unset;

View File

@ -17,7 +17,7 @@
use Luracast\Restler\RestException;
require 'ticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';

View File

@ -258,8 +258,8 @@ print '<div class="underbanner clearboth"></div>';
if ($user->admin) {
print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
}
// Show warning about external users
if (empty($user->socid)) {
// If edited user is an extern user, we show warning for external users
if (! empty($object->socid)) {
print info_admin(showModulesExludedForExternal($modules))."\n";
}

View File

@ -1091,8 +1091,8 @@ class Website extends CommonObject
}
}
$line .= "\n-- For Dolibarr v14+ --\n";
$line .= "UPDATE llx_website SET fk_default_lang = '".$this->db->escape($this->fk_default_lang)."' WHERE rowid = __WEBSITE_ID__;\n";
$line = "\n-- For Dolibarr v14+ --;\n";
$line .= "UPDATE llx_website SET lang = '".$this->db->escape($this->fk_default_lang)."' WHERE rowid = __WEBSITE_ID__;\n";
$line .= "UPDATE llx_website SET otherlang = '".$this->db->escape($this->otherlang)."' WHERE rowid = __WEBSITE_ID__;\n";
$line .= "\n";
fputs($fp, $line);