Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
04ca203ee8
@ -839,20 +839,29 @@ class AccountancyCategory // extends CommonObject
|
||||
exit();
|
||||
}
|
||||
|
||||
$pcgverid = $conf->global->CHARTOFACCOUNTS;
|
||||
$pcgvercode = dol_getIdFromCode($this->db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
|
||||
if (empty($pcgvercode)) {
|
||||
$pcgvercode = $pcgverid;
|
||||
}
|
||||
|
||||
if (!empty($cat_id)) {
|
||||
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as t";
|
||||
$sql .= " WHERE t.fk_accounting_category = ".((int) $cat_id);
|
||||
$sql .= " AND t.entity = ".$conf->entity;
|
||||
$sql .= " AND t.active = 1";
|
||||
$sql .= " AND t.fk_pcg_version = '".$this->db->escape($pcgvercode)."'";
|
||||
$sql .= " ORDER BY t.account_number";
|
||||
} else {
|
||||
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as t";
|
||||
$sql .= " WHERE ".$predefinedgroupwhere;
|
||||
$sql .= " AND t.entity = ".$conf->entity;
|
||||
$sql .= ' AND t.active = 1';
|
||||
$sql .= " AND t.fk_pcg_version = '".$this->db->escape($pcgvercode)."'";
|
||||
$sql .= " ORDER BY t.account_number";
|
||||
}
|
||||
//echo $sql;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@ -667,7 +667,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
* conditions and billing date.
|
||||
*
|
||||
* @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition.
|
||||
* @return integer Date limite de reglement si ok, <0 si ko
|
||||
* @return integer Date limit of payment if OK, <0 if KO
|
||||
*/
|
||||
public function calculate_date_lim_reglement($cond_reglement = 0)
|
||||
{
|
||||
@ -678,6 +678,9 @@ abstract class CommonInvoice extends CommonObject
|
||||
if (!$cond_reglement) {
|
||||
$cond_reglement = $this->cond_reglement_id;
|
||||
}
|
||||
if (!$cond_reglement) {
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
$cdr_nbjour = 0;
|
||||
$cdr_type = 0;
|
||||
|
||||
@ -8359,7 +8359,7 @@ abstract class CommonObject
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && ($action == 'view' || $action == 'valid' || $action == 'editline' || $action == 'confirm_valid' || $action == 'confirm_cancel')) {
|
||||
$out .= '<td></td>';
|
||||
}
|
||||
$out .= '<td class="titlefieldcreate wordbreak';
|
||||
$out .= '<td class="'.(empty($params['tdclass']) ? 'titlefieldcreate' : $params['tdclass']).' wordbreak';
|
||||
} elseif ($display_type == 'line') {
|
||||
$out .= '<div '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="fieldline_options_'.$key.' '.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$collapse_group.'" '.$domData.' >';
|
||||
$out .= '<div style="display: inline-block; padding-right:4px" class="wordbreak';
|
||||
|
||||
@ -811,7 +811,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
|
||||
// Array to define rules of checks to do
|
||||
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment'); // Test on entity only (Objects with no link to company)
|
||||
$checksoc = array('societe'); // Test for object Societe
|
||||
$checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
|
||||
$checkother = array('contact', 'agenda', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
|
||||
$checkproject = array('projet', 'project'); // Test for project object
|
||||
$checktask = array('projet_task'); // Test for task object
|
||||
$checkhierarchy = array('expensereport', 'holiday'); // check permission among the hierarchy of user
|
||||
|
||||
@ -45,10 +45,13 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object,
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
$params = array();
|
||||
if (isset($tpl_context)) {
|
||||
$params['tpl_context'] = $tpl_context;
|
||||
}
|
||||
$params['cols'] = key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : '';
|
||||
if (!empty($parameters['tdclass'])) {
|
||||
$params['tdclass'] = $parameters['tdclass'];
|
||||
}
|
||||
if (!empty($parameters['tpl_context'])) {
|
||||
$params['tpl_context'] = $parameters['tpl_context'];
|
||||
}
|
||||
|
||||
print $object->showOptionals($extrafields, 'create', $params);
|
||||
}
|
||||
|
||||
@ -3111,16 +3111,17 @@ class FactureFournisseur extends CommonInvoice
|
||||
$object->fk_facture_source = 0;
|
||||
$object->date_creation = '';
|
||||
$object->date_validation = '';
|
||||
$object->date = (empty($this->date) ? '' : $this->date);
|
||||
$object->date_echeance = '';
|
||||
$object->date = (empty($this->date) ? dol_now() : $this->date);
|
||||
$object->ref_client = '';
|
||||
$object->close_code = '';
|
||||
$object->close_note = '';
|
||||
if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING == 1) {
|
||||
if (getDolGlobalInt('MAIN_DONT_KEEP_NOTE_ON_CLONING') == 1) {
|
||||
$object->note_private = '';
|
||||
$object->note_public = '';
|
||||
}
|
||||
|
||||
$object->date_echeance = $object->calculate_date_lim_reglement();
|
||||
|
||||
// Loop on each line of new invoice
|
||||
foreach ($object->lines as $i => $line) {
|
||||
if (isset($object->lines[$i]->info_bits) && ($object->lines[$i]->info_bits & 0x02) == 0x02) { // We do not clone line of discounts
|
||||
|
||||
@ -29,7 +29,7 @@ PartnershipCheckBacklink=Partnership: Check referring backlink
|
||||
# Menu
|
||||
#
|
||||
NewPartnership=New Partnership
|
||||
NewPartnershipbyWeb= Your partnership was added successfully.
|
||||
NewPartnershipbyWeb=Your partnership request has been added successfully. We may contact you soon...
|
||||
ListOfPartnerships=List of partnership
|
||||
|
||||
#
|
||||
|
||||
@ -29,7 +29,7 @@ PartnershipCheckBacklink=Partenariat : Vérifiez le backlink référent
|
||||
# Menu
|
||||
#
|
||||
NewPartnership=Nouveau partenariat
|
||||
NewPartnershipbyWeb= Votre partenariat a été ajouté avec succès.
|
||||
NewPartnershipbyWeb=Votre demande de partenariat a été ajouté avec succès. Nous vous recontacterons surement d'ici peu...
|
||||
ListOfPartnerships=Listes des partenariats
|
||||
|
||||
#
|
||||
|
||||
@ -104,7 +104,8 @@ class Partnership extends CommonObject
|
||||
'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'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>15, 'notnull'=>1, 'visible'=>-2, 'default'=>'1', 'index'=>1,),
|
||||
'fk_type' => array('type'=>'integer:PartnershipType:partnership/class/partnership_type.class.php:0:active=1', 'label'=>'Type', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1,),
|
||||
'fk_type' => array('type'=>'integer:PartnershipType:partnership/class/partnership_type.class.php:0:active=1', 'label'=>'Type', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflowmax100'),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax125',),
|
||||
'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,),
|
||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
|
||||
@ -121,7 +122,6 @@ class Partnership extends CommonObject
|
||||
'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',),
|
||||
'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>-2,),
|
||||
'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>73, 'notnull'=>0, 'visible'=>-2,),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150',),
|
||||
'ip' => array('type'=>'varchar(250)', 'label'=>'Ip', 'enabled'=>'1', 'position'=>74, 'notnull'=>0, 'visible'=>-2,),
|
||||
);
|
||||
public $rowid;
|
||||
|
||||
@ -42,8 +42,14 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object,
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
$params = array();
|
||||
if (isset($tpl_context)) $params['tpl_context'] = $tpl_context;
|
||||
$params['cols'] = $parameters['colspanvalue'];
|
||||
$params['cols'] = key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : '';
|
||||
if (!empty($parameters['tdclass'])) {
|
||||
$params['tdclass'] = $parameters['tdclass'];
|
||||
}
|
||||
if (!empty($parameters['tpl_context'])) {
|
||||
$params['tpl_context'] = $parameters['tpl_context'];
|
||||
}
|
||||
|
||||
print $object->showOptionals($extrafields, 'create', $params);
|
||||
}
|
||||
|
||||
|
||||
@ -506,7 +506,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // fetch optio
|
||||
|
||||
llxHeaderVierge($langs->trans("NewSubscription"));
|
||||
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center');
|
||||
|
||||
|
||||
@ -686,7 +686,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
|
||||
print '<tr><td>'.$langs->trans("Public").'</td><td><input type="checkbox" name="public"></td></tr>'."\n";
|
||||
|
||||
// Other attributes
|
||||
$tpl_context = 'public'; // define template context to public
|
||||
$parameters['tpl_context']='public'; // define template context to public
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
|
||||
// Comments
|
||||
|
||||
@ -535,7 +535,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // fetch optio
|
||||
|
||||
llxHeaderVierge($langs->trans("NewPartnershipRequest"));
|
||||
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("NewPartnershipRequest"), '', '', 0, 0, 'center');
|
||||
|
||||
|
||||
@ -577,44 +577,25 @@ jQuery(document).ready(function () {
|
||||
</script>';
|
||||
|
||||
|
||||
print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
|
||||
|
||||
// Type
|
||||
/*
|
||||
if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) {
|
||||
$listoftype = $partnershipt->liste_array();
|
||||
$tmp = array_keys($listoftype);
|
||||
$defaulttype = '';
|
||||
$isempty = 1;
|
||||
if (count($listoftype) == 1) {
|
||||
$defaulttype = $tmp[0];
|
||||
$isempty = 0;
|
||||
}
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").' <span style="color: red">*</span></td><td>';
|
||||
print $form->selectarray("typeid", $partnershipt->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty);
|
||||
print '</td></tr>'."\n";
|
||||
} else {
|
||||
$partnershipt->fetch($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE);
|
||||
print '<input type="hidden" id="typeid" name="typeid" value="'.$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE.'">';
|
||||
}
|
||||
*/
|
||||
|
||||
$partnershiptype = new PartnershipType($db);
|
||||
$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000);
|
||||
$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000, 0, array('active'=>1));
|
||||
$listofpartnership = array();
|
||||
foreach ($listofpartnershipobj as $partnershipobj) {
|
||||
$listofpartnership[$partnershipobj->id] = $partnershipobj->label;
|
||||
}
|
||||
|
||||
if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) {
|
||||
print '<tr class="morphy"><td class="titlefield">'.$langs->trans('PartnershipType').' <span style="color: red">*</span></td><td>'."\n";
|
||||
print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1);
|
||||
print '</td></tr>'."\n";
|
||||
} else {
|
||||
if (getDolGlobalString('PARTNERSHIP_NEWFORM_FORCETYPE')) {
|
||||
print $listofpartnership[$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE];
|
||||
print '<input type="hidden" id="partnershiptype" name="partnershiptype" value="'.$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE.'">';
|
||||
}
|
||||
|
||||
print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
|
||||
if (!getDolGlobalString('PARTNERSHIP_NEWFORM_FORCETYPE')) {
|
||||
print '<tr class="morphy"><td>'.$langs->trans('PartnershipType').' <span style="color: red">*</span></td><td>'."\n";
|
||||
print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
// Company
|
||||
print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").' <span style="color:red;">*</span></td><td>';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
@ -668,7 +649,8 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
|
||||
// Logo
|
||||
//print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n";
|
||||
// Other attributes
|
||||
$tpl_context = 'public'; // define template context to public
|
||||
$parameters['tdclass']='titlefieldauto';
|
||||
$parameters['tpl_context']='public'; // define template context to public
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
// Comments
|
||||
print '<tr>';
|
||||
|
||||
@ -534,7 +534,7 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$tpl_context = 'public'; // define template context to public
|
||||
$parameters['tpl_context']='public'; // define template context to public
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
// Comments
|
||||
print '<tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user