Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop_atm
This commit is contained in:
commit
1cc816ff38
@ -117,30 +117,6 @@ if ($action == 'validatehistory') {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
|
||||
}
|
||||
} elseif ($action == 'cleanaccountancycode') {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
// Now clean
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql1.= " SET fk_code_ventilation = 0";
|
||||
$sql1.= " WHERE fd.fk_facture IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql1.= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
|
||||
$sql1.= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
|
||||
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql1.=")";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
|
||||
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('Done'), 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -183,8 +159,6 @@ print '<br>';
|
||||
$y = $year_current;
|
||||
|
||||
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
|
||||
$buttonreset = '';
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $buttonreset = '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>';
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
@ -262,7 +236,7 @@ print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), $buttonreset, '');
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -110,27 +110,37 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
$error = 0;
|
||||
|
||||
if (! (GETPOST('account_parent','int') >= 0))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent','int');
|
||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
if (! $error)
|
||||
{
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
|
||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
|
||||
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
||||
}
|
||||
|
||||
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
||||
}
|
||||
|
||||
|
||||
@ -272,7 +282,7 @@ if ($result) {
|
||||
print $langs->trans("DescVentilDoneCustomer") . '<br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 1);
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
|
||||
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '"/></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@ -114,30 +114,6 @@ if ($action == 'validatehistory') {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
|
||||
}
|
||||
} elseif ($action == 'cleanaccountancycode') {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
// Now clean
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1.= " SET fk_code_ventilation = 0";
|
||||
$sql1.= " WHERE erd.fk_expensereport IN ( SELECT er.rowid FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||
$sql1.= " WHERE er.date_debut >= '" . $db->idate($search_date_start) . "'";
|
||||
$sql1.= " AND er.date_debut <= '" . $db->idate($search_date_end) . "'";
|
||||
$sql1.= " AND er.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql1.=")";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
|
||||
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('Done'), 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -180,8 +156,6 @@ print '<br>';
|
||||
$y = $year_current;
|
||||
|
||||
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
|
||||
$buttonreset = '';
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $buttonreset = '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>';
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
@ -253,7 +227,7 @@ print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), $buttonreset, '');
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
|
||||
@ -43,7 +43,7 @@ $langs->load("accountancy");
|
||||
$langs->load("trips");
|
||||
$langs->load("productbatch");
|
||||
|
||||
$account_parent = GETPOST('account_parent');
|
||||
$account_parent = GETPOST('account_parent','int');
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
// Search Getpost
|
||||
$search_expensereport = GETPOST('search_expensereport', 'alpha');
|
||||
@ -103,27 +103,36 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
$error = 0;
|
||||
|
||||
if (! (GETPOST('account_parent','int') >= 0))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1 .= " SET erd.fk_code_ventilation=" . GETPOST('account_parent','int');
|
||||
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
if (! $error)
|
||||
{
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1 .= " SET erd.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
|
||||
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
|
||||
dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= ' . $sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= ' . $sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
|
||||
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
||||
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -246,7 +255,7 @@ if ($result) {
|
||||
print $langs->trans("DescVentilDoneExpenseReport") . '<br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
||||
print $formaccounting->select_account(GETPOST('account_parent'), 'account_parent', 1);
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
|
||||
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '" /></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@ -115,31 +115,9 @@ if ($action == 'validatehistory') {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
|
||||
}
|
||||
} elseif ($action == 'cleanaccountancycode') {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
||||
$sql1.= " SET fk_code_ventilation = 0";
|
||||
$sql1.= " WHERE fd.fk_facture_fourn IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql1.= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
|
||||
$sql1.= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
||||
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql1.= ")";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
|
||||
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('Done'), 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -178,8 +156,6 @@ print '<br>';
|
||||
$y = $year_current;
|
||||
|
||||
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
|
||||
$buttonreset = '';
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $buttonreset = '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>';
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
@ -252,7 +228,7 @@ print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), $buttonreset, '');
|
||||
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -111,27 +111,36 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
$error = 0;
|
||||
|
||||
if (! (GETPOST('account_parent','int') >= 0))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent','int');
|
||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
if (! $error)
|
||||
{
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
if (! $error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
|
||||
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
||||
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -269,7 +278,7 @@ if ($result) {
|
||||
print $langs->trans("DescVentilDoneSupplier") . '<br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 1);
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
|
||||
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '" /></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@ -1049,13 +1049,15 @@ class Adherent extends CommonObject
|
||||
/**
|
||||
* Load member from database
|
||||
*
|
||||
* @param int $rowid Id of object to load
|
||||
* @param string $ref To load member from its ref
|
||||
* @param int $fk_soc To load member from its link to third party
|
||||
* @param string $ref_ext External reference
|
||||
* @return int >0 if OK, 0 if not found, <0 if KO
|
||||
* @param int $rowid Id of object to load
|
||||
* @param string $ref To load member from its ref
|
||||
* @param int $fk_soc To load member from its link to third party
|
||||
* @param string $ref_ext External reference
|
||||
* @param bool $fetch_optionals To load optionals (extrafields)
|
||||
* @param bool $fetch_subscriptions To load member subscriptions
|
||||
* @return int >0 if OK, 0 if not found, <0 if KO
|
||||
*/
|
||||
function fetch($rowid,$ref='',$fk_soc='',$ref_ext='')
|
||||
function fetch($rowid,$ref='',$fk_soc='',$ref_ext='',$fetch_optionals=true,$fetch_subscriptions=true)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -1160,10 +1162,14 @@ class Adherent extends CommonObject
|
||||
|
||||
// Retreive all extrafield
|
||||
// fetch optionals attributes and labels
|
||||
$this->fetch_optionals();
|
||||
if ($fetch_optionals) {
|
||||
$this->fetch_optionals();
|
||||
}
|
||||
|
||||
// Load other properties
|
||||
$result=$this->fetch_subscriptions();
|
||||
if ($fetch_subscriptions) {
|
||||
$result=$this->fetch_subscriptions();
|
||||
}
|
||||
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
@ -332,7 +332,9 @@ class AdherentType extends CommonObject
|
||||
* Return array of Member objects for member type this->id (or all if this->id not defined)
|
||||
*
|
||||
* @param string $excludefilter Filter to exclude
|
||||
* @param int $mode 0=Return array of member instance, 1=Return array of members id only
|
||||
* @param int $mode 0=Return array of member instance
|
||||
* 1=Return array of member instance without extra data
|
||||
* 2=Return array of members id only
|
||||
* @return mixed Array of members or -1 on error
|
||||
*/
|
||||
function listMembersForMemberType($excludefilter='', $mode=0)
|
||||
@ -355,10 +357,14 @@ class AdherentType extends CommonObject
|
||||
{
|
||||
if (! array_key_exists($obj->rowid, $ret))
|
||||
{
|
||||
if ($mode != 1)
|
||||
if ($mode < 2)
|
||||
{
|
||||
$memberstatic=new Adherent($this->db);
|
||||
$memberstatic->fetch($obj->rowid);
|
||||
if ($mode == 1) {
|
||||
$memberstatic->fetch($obj->rowid,'','','',false, false);
|
||||
} else {
|
||||
$memberstatic->fetch($obj->rowid);
|
||||
}
|
||||
$ret[$obj->rowid]=$memberstatic;
|
||||
}
|
||||
else $ret[$obj->rowid]=$obj->rowid;
|
||||
@ -457,7 +463,7 @@ class AdherentType extends CommonObject
|
||||
foreach($this->members as $key=>$val) // This is array of users for group into dolibarr database.
|
||||
{
|
||||
$member=new Adherent($this->db);
|
||||
$member->fetch($val->id);
|
||||
$member->fetch($val->id,'','','',false,false);
|
||||
$info2 = $member->_load_ldap_info();
|
||||
$valueofldapfield[] = $member->_load_ldap_dn($info2);
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ if (empty($reshook))
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$object->listMembersForMemberType();
|
||||
$object->listMembersForMemberType('', 1);
|
||||
|
||||
$info = $object->_load_ldap_info();
|
||||
$dn = $object->_load_ldap_dn($info);
|
||||
|
||||
@ -41,7 +41,7 @@ $month=GETPOST("month",'int');
|
||||
$day=GETPOST("day",'int');
|
||||
$pid=GETPOST("projectid",'int',3);
|
||||
$status=GETPOST("status",'alpha');
|
||||
$type=GETPOST('type');
|
||||
$type=GETPOST('type','alphanohtml');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('actioncode','array'))
|
||||
@ -355,7 +355,7 @@ if ($resql)
|
||||
//if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
|
||||
//if ($resourceid) $nav.='<input type="hidden" name="resourceid" value="'.$resourceid.'">';
|
||||
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
|
||||
if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
|
||||
//if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
|
||||
//if ($socid) $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
if ($showbirthday) $nav.='<input type="hidden" name="showbirthday" value="1">';
|
||||
//if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
|
||||
|
||||
@ -616,7 +616,7 @@ if (empty($reshook))
|
||||
// Close proposal
|
||||
else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel','alpha'))
|
||||
{
|
||||
if (! GETPOST('statut','int')) {
|
||||
if (! (GETPOST('statut','int') > 0)) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
|
||||
$action = 'statut';
|
||||
} else {
|
||||
|
||||
@ -455,7 +455,7 @@ $parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM ";
|
||||
if ($search_bid) $sql.= MAIN_DB_PREFIX."bank_class as l,";
|
||||
if ($search_bid>0) $sql.= MAIN_DB_PREFIX."bank_class as l,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."bank as b";
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||
|
||||
@ -366,7 +366,7 @@ $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.c
|
||||
$sql.= " typent.code as typent_code,";
|
||||
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql.= " country.code as country_code,";
|
||||
$sql.= " p.rowid as project_id, p.ref as project_ref";
|
||||
$sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
|
||||
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
|
||||
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
||||
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
||||
@ -979,6 +979,7 @@ if ($resql)
|
||||
{
|
||||
$projectstatic->id=$obj->project_id;
|
||||
$projectstatic->ref=$obj->project_ref;
|
||||
$projectstatic->title=$obj->project_label;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -52,7 +52,6 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
$modetax = $conf->global->TAX_MODE;
|
||||
if (isset($_GET["modetax"])) $modetax=GETPOST("modetax",'alpha');
|
||||
|
||||
|
||||
/**
|
||||
* print function
|
||||
*
|
||||
@ -174,16 +173,16 @@ $y = $year_current ;
|
||||
$total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
|
||||
$i=0;
|
||||
for ($m = 1 ; $m < 13 ; $m++ ) {
|
||||
$coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m);
|
||||
$coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m);
|
||||
|
||||
$coll_listsell = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'sell', $m);
|
||||
$coll_listbuy = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'buy', $m);
|
||||
|
||||
$action = "tva";
|
||||
$object = array(&$coll_listsell, &$coll_listbuy);
|
||||
$parameters["mode"] = $modetax;
|
||||
$parameters["year"] = $y;
|
||||
$parameters["month"] = $m;
|
||||
$parameters["type"] = 'localtax'.$localTaxType;
|
||||
|
||||
|
||||
// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('externalbalance'));
|
||||
$reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
@ -198,7 +197,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'</td>';
|
||||
if($CalcLT==0) {
|
||||
@ -229,7 +228,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) {
|
||||
}
|
||||
$subtotalcoll = $subtotalcoll + $x_coll;
|
||||
print "<td class=\"nowrap\" align=\"right\">".price($x_coll)."</td><td></td>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
if($CalcLT==0) {
|
||||
@ -239,7 +238,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) {
|
||||
} elseif($CalcLT==2) {
|
||||
$diff= $x_coll;
|
||||
}
|
||||
|
||||
|
||||
$total = $total + $diff;
|
||||
$subtotal = $subtotal + $diff;
|
||||
|
||||
|
||||
@ -107,13 +107,13 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
|
||||
}
|
||||
|
||||
// $date_start and $date_end are defined. We force $start_year and $nbofyear
|
||||
// $date_start and $date_end are defined. We force $year_start and $nbofyear
|
||||
$tmps=dol_getdate($date_start);
|
||||
$start_year = $tmps['year'];
|
||||
$year_start = $tmps['year'];
|
||||
$tmpe=dol_getdate($date_end);
|
||||
$year_end = $tmpe['year'];
|
||||
$nbofyear = ($year_end - $start_year) + 1;
|
||||
//var_dump($start_year." ".$end_year." ".$nbofyear);
|
||||
//var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour'));
|
||||
|
||||
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
|
||||
$modecompta = $conf->global->ACCOUNTING_MODE;
|
||||
@ -253,8 +253,8 @@ if ($modecompta == 'BOOKKEEPING')
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
$sql.= " WHERE f.numero_compte = aa.account_number";
|
||||
//$sql.= " AND fk_statut in (1,2)";
|
||||
$sql.= " AND ".$predefinedgroupwhere;
|
||||
$sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'";
|
||||
@ -295,7 +295,7 @@ if ($modecompta == 'BOOKKEEPING')
|
||||
if ($showaccountdetail != 'no')
|
||||
{
|
||||
$tmppredefinedgroupwhere="pcg_type = '".$db->escape($objp->pcg_type)."' AND pcg_subtype = '".$db->escape($objp->pcg_subtype)."'";
|
||||
$tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$charofaccountstring."'";
|
||||
$tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'";
|
||||
//$tmppredefinedgroupwhere.= " AND thirdparty_code = '".$db->escape($objp->name)."'";
|
||||
|
||||
// Get cpts of category/group
|
||||
@ -312,7 +312,7 @@ if ($modecompta == 'BOOKKEEPING')
|
||||
}
|
||||
|
||||
|
||||
if ($showaccountdetail == 'all' || $resultN > 0)
|
||||
if ($showaccountdetail == 'all' || $resultN <> 0)
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td></td>';
|
||||
|
||||
@ -85,13 +85,14 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
|
||||
}
|
||||
|
||||
// $date_start and $date_end are defined. We force $start_year and $nbofyear
|
||||
// $date_start and $date_end are defined. We force $year_start and $nbofyear
|
||||
$tmps=dol_getdate($date_start);
|
||||
$start_year = $tmps['year'];
|
||||
$year_start = $tmps['year'];
|
||||
$tmpe=dol_getdate($date_end);
|
||||
$year_end = $tmpe['year'];
|
||||
$nbofyear = ($year_end - $start_year) + 1;
|
||||
//var_dump($start_year." ".$end_year." ".$nbofyear);
|
||||
//var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour'));
|
||||
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
@ -376,7 +377,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
@ -409,7 +409,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
@ -443,7 +442,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
@ -474,7 +472,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
@ -537,7 +534,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
@ -600,7 +596,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
@ -647,7 +642,6 @@ if (! empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $m
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$var = false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
@ -775,7 +769,6 @@ if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
@ -810,32 +803,35 @@ elseif ($modecompta == 'BOOKKEEPING') {
|
||||
|
||||
if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
|
||||
{
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
$predefinedgroupwhere = "(";
|
||||
//$predefinedgroupwhere.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))";
|
||||
$predefinedgroupwhere.= " (pcg_type = 'EXPENSE')";
|
||||
$predefinedgroupwhere.= " OR ";
|
||||
//$predefinedgroupwhere.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))";
|
||||
$predefinedgroupwhere.= " (pcg_type = 'INCOME')";
|
||||
$predefinedgroupwhere.= ")";
|
||||
|
||||
$charofaccountstring = $conf->global->CHARTOFACCOUNTS;
|
||||
$charofaccountstring=dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
$sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
$sql.= " WHERE b.numero_compte = aa.account_number AND b.entity = ".$conf->entity;
|
||||
//$sql.= " AND fk_statut in (1,2)";
|
||||
$sql.= " AND (";
|
||||
//$sql.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))";
|
||||
$sql.= " (pcg_type = 'EXPENSE')";
|
||||
$sql.= " OR ";
|
||||
//$sql.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))";
|
||||
$sql.= " (pcg_type = 'INCOME')";
|
||||
$sql.= ")";
|
||||
//$sql.= " AND code_journal in ('VT', 'AC')";
|
||||
$sql.= " AND ".$predefinedgroupwhere;
|
||||
$sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'";
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND b.doc_date >= '".$db->idate($date_start)."' AND b.doc_date <= '".$db->idate($date_end)."'";
|
||||
$sql.= " GROUP BY b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, dm";
|
||||
//print $sql;
|
||||
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
|
||||
dol_syslog("get bookkeeping record");
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
@ -845,9 +841,8 @@ if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
|
||||
|
||||
if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0;
|
||||
$encaiss[$obj->dm] += $obj->debit;
|
||||
|
||||
if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0;
|
||||
$encaiss_ttc[$obj->dm] += $obj->credit;
|
||||
$encaiss_ttc[$obj->dm] += 0;
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -908,7 +903,6 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
|
||||
// Loop on each month
|
||||
$nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START-1):0;
|
||||
@ -926,21 +920,44 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
|
||||
$case = strftime("%Y-%m",dol_mktime(12,0,0,$mois_modulo,1,$annee_decalage));
|
||||
|
||||
print '<td align="right"> ';
|
||||
if (isset($decaiss_ttc[$case]) && $decaiss_ttc[$case] != 0)
|
||||
if ($modecompta == 'BOOKKEEPING')
|
||||
{
|
||||
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($decaiss_ttc[$case],'MT')).'</a>';
|
||||
if (! isset($totsorties[$annee])) $totsorties[$annee]=0;
|
||||
$totsorties[$annee]+=$decaiss_ttc[$case];
|
||||
if (isset($decaiss[$case]) && $decaiss[$case] != 0)
|
||||
{
|
||||
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($decaiss[$case],'MT')).'</a>';
|
||||
if (! isset($totsorties[$annee])) $totsorties[$annee]=0;
|
||||
$totsorties[$annee]+=$decaiss[$case];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($decaiss_ttc[$case]) && $decaiss_ttc[$case] != 0)
|
||||
{
|
||||
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($decaiss_ttc[$case],'MT')).'</a>';
|
||||
if (! isset($totsorties[$annee])) $totsorties[$annee]=0;
|
||||
$totsorties[$annee]+=$decaiss_ttc[$case];
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print '<td align="right" class="borderrightlight"> ';
|
||||
//if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0)
|
||||
if (isset($encaiss_ttc[$case]))
|
||||
if ($modecompta == 'BOOKKEEPING')
|
||||
{
|
||||
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($encaiss_ttc[$case],'MT')).'</a>';
|
||||
if (! isset($totentrees[$annee])) $totentrees[$annee]=0;
|
||||
$totentrees[$annee]+=$encaiss_ttc[$case];
|
||||
if (isset($encaiss[$case]))
|
||||
{
|
||||
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($encaiss[$case],'MT')).'</a>';
|
||||
if (! isset($totentrees[$annee])) $totentrees[$annee]=0;
|
||||
$totentrees[$annee]+=$encaiss[$case];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($encaiss_ttc[$case]))
|
||||
{
|
||||
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($encaiss_ttc[$case],'MT')).'</a>';
|
||||
if (! isset($totentrees[$annee])) $totentrees[$annee]=0;
|
||||
$totentrees[$annee]+=$encaiss_ttc[$case];
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
@ -951,7 +968,10 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
|
||||
// Total
|
||||
|
||||
$nbcols=0;
|
||||
print '<tr class="liste_total impair"><td>'.$langs->trans("TotalTTC").'</td>';
|
||||
print '<tr class="liste_total impair"><td>';
|
||||
if ($modecompta == 'BOOKKEEPING') print $langs->trans("Total");
|
||||
else print $langs->trans("TotalTTC");
|
||||
print '</td>';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
$nbcols+=2;
|
||||
|
||||
@ -160,8 +160,8 @@ $total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
|
||||
$i=0;
|
||||
for ($m = 1 ; $m < 13 ; $m++ )
|
||||
{
|
||||
$coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m);
|
||||
$coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m);
|
||||
$coll_listsell = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'sell', $m);
|
||||
$coll_listbuy = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'buy', $m);
|
||||
|
||||
$action = "tva";
|
||||
$object = array(&$coll_listsell, &$coll_listbuy);
|
||||
|
||||
@ -198,8 +198,8 @@ $i=0;
|
||||
$columns = 5;
|
||||
|
||||
// Load arrays of datas
|
||||
$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell');
|
||||
$x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy');
|
||||
$x_coll = tax_by_date('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'sell');
|
||||
$x_paye = tax_by_date('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'buy');
|
||||
|
||||
if (! is_array($x_coll) || ! is_array($x_paye))
|
||||
{
|
||||
|
||||
@ -101,7 +101,7 @@ if (! $sortfield) $sortfield='a.datep, a.id';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('contactcard','globalcard'));
|
||||
$hookmanager->initHooks(array('contactagenda','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -6551,7 +6551,7 @@ abstract class CommonObject
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function set_save_query()
|
||||
protected function setSaveQuery()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -6650,7 +6650,7 @@ abstract class CommonObject
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function get_field_list()
|
||||
protected function getFieldList()
|
||||
{
|
||||
$keys = array_keys($this->fields);
|
||||
return implode(',', $keys);
|
||||
@ -6685,7 +6685,7 @@ abstract class CommonObject
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$fieldvalues = $this->set_save_query();
|
||||
$fieldvalues = $this->setSaveQuery();
|
||||
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation']=$this->db->idate($now);
|
||||
if (array_key_exists('fk_user_creat', $fieldvalues) && ! ($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat']=$user->id;
|
||||
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
|
||||
@ -6778,7 +6778,7 @@ abstract class CommonObject
|
||||
{
|
||||
if (empty($id) && empty($ref)) return false;
|
||||
|
||||
$sql = 'SELECT '.$this->get_field_list();
|
||||
$sql = 'SELECT '.$this->getFieldList();
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
|
||||
|
||||
if (!empty($id)) $sql.= ' WHERE rowid = '.$id;
|
||||
@ -6822,7 +6822,7 @@ abstract class CommonObject
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$fieldvalues = $this->set_save_query();
|
||||
$fieldvalues = $this->setSaveQuery();
|
||||
if (array_key_exists('date_modification', $fieldvalues) && empty($fieldvalues['date_modification'])) $fieldvalues['date_modification']=$this->db->idate($now);
|
||||
if (array_key_exists('fk_user_modif', $fieldvalues) && ! ($fieldvalues['fk_user_modif'] > 0)) $fieldvalues['fk_user_modif']=$user->id;
|
||||
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into update.
|
||||
|
||||
@ -1743,7 +1743,7 @@ class ExtraFields
|
||||
*/
|
||||
function showSeparator($key)
|
||||
{
|
||||
$out = '<tr class="trextrafieldseparator"><td colspan="4"><strong>'.$this->attribute_label[$key].'</strong></td></tr>';
|
||||
$out = '<tr class="trextrafieldseparator trextrafieldseparator'.$key.'"><td colspan="4"><strong>'.$this->attribute_label[$key].'</strong></td></tr>';
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
@ -243,7 +243,7 @@ class FormAccounting extends Form
|
||||
*
|
||||
* @param string $selectid Preselected id or code of accounting accounts (depends on $select_in)
|
||||
* @param string $htmlname Name of HTML field id. If name start with '.', it is name of HTML css class, so several component with same name in different forms can be used.
|
||||
* @param int $showempty Add an empty field
|
||||
* @param int $showempty 1=Add an empty field, 2=Add an empty field+'None' field
|
||||
* @param array $event Event options
|
||||
* @param int $select_in 0=selectid value is a aa.rowid (default) or 1=selectid is aa.account_number
|
||||
* @param int $select_out Set value returned by select. 0=rowid (default), 1=account_number
|
||||
@ -253,7 +253,7 @@ class FormAccounting extends Form
|
||||
*/
|
||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='')
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
@ -318,7 +318,12 @@ class FormAccounting extends Form
|
||||
}
|
||||
}
|
||||
|
||||
$out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
if ($showempty == 2)
|
||||
{
|
||||
$options['0'] = $langs->trans("None");
|
||||
}
|
||||
|
||||
$out .= Form::selectarray($htmlname, $options, $selected, ($showempty > 0 ? 1 : 0), 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -122,13 +122,13 @@ class FormBarCode
|
||||
|
||||
if ($useempty && $num > 0)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'" id="select_'.$htmlname.'">';
|
||||
print '<select class="flat minwidth75imp" name="'.$htmlname.'" id="select_'.$htmlname.'">';
|
||||
print '<option value="0"> </option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<select disabled class="flat" name="'.$htmlname.'" id="select_'.$htmlname.'">';
|
||||
print '<select disabled class="flat minwidth75imp" name="'.$htmlname.'" id="select_'.$htmlname.'">';
|
||||
print '<option value="0" selected>'.$langs->trans('ErrorNoActivatedBarcode').'</option>';
|
||||
}
|
||||
|
||||
|
||||
209
htdocs/core/get_info.php
Normal file
209
htdocs/core/get_info.php
Normal file
@ -0,0 +1,209 @@
|
||||
<?php
|
||||
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This file is a modified version of datepicker.php from phpBSM to fix some
|
||||
* bugs, to add new features and to dramatically increase speed.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/get_info.php
|
||||
* \brief File to return a single page with just logged user info, to be used by other frontend
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
|
||||
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
|
||||
//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
|
||||
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||
|
||||
require_once '../main.inc.php';
|
||||
|
||||
if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
||||
|
||||
$langs->load("main");
|
||||
|
||||
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
||||
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title=$langs->trans("Info");
|
||||
|
||||
// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests
|
||||
$head='<!-- Quick access -->'."\n";
|
||||
$arrayofjs=array();
|
||||
$arrayofcss=array();
|
||||
top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
|
||||
|
||||
|
||||
|
||||
print '<body>'."\n";
|
||||
print '<div style="padding: 20px;">';
|
||||
//print '<br>';
|
||||
|
||||
$nbofsearch=0;
|
||||
|
||||
// Define link to login card
|
||||
$appli=constant('DOL_APPLICATION_TITLE');
|
||||
if (! empty($conf->global->MAIN_APPLICATION_TITLE))
|
||||
{
|
||||
$appli=$conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (preg_match('/\d\.\d/', $appli))
|
||||
{
|
||||
if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core
|
||||
}
|
||||
else $appli.=" ".DOL_VERSION;
|
||||
}
|
||||
else $appli.=" ".DOL_VERSION;
|
||||
|
||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $appli.="<br>".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL;
|
||||
|
||||
$logouttext='';
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
//$logouthtmltext=$appli.'<br>';
|
||||
if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http')
|
||||
{
|
||||
$logouthtmltext.=$langs->trans("Logout").'<br>';
|
||||
|
||||
$logouttext .='<a href="'.DOL_URL_ROOT.'/user/logout.php">';
|
||||
//$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
|
||||
$logouttext .='<span class="fa fa-sign-out atoplogin"></span>';
|
||||
$logouttext .='</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$logouthtmltext.=$langs->trans("NoLogoutProcessWithAuthMode",$_SESSION["dol_authmode"]);
|
||||
$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
print '<div class="login_block_getinfo">'."\n";
|
||||
|
||||
// Add login user link
|
||||
$toprightmenu.='<div class="login_block_user">';
|
||||
|
||||
// Login name with photo and tooltip
|
||||
$mode=-1;
|
||||
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
|
||||
$toprightmenu.=$user->getNomUrl($mode, '', -1, 0, 11, 0, ($user->firstname ? 'firstname' : -1),'atoplogin');
|
||||
$toprightmenu.='</div></div>';
|
||||
|
||||
$toprightmenu.='</div>'."\n";
|
||||
|
||||
$toprightmenu.='<div class="login_block_other">';
|
||||
|
||||
// Execute hook printTopRightMenu (hooks should output string like '<div class="login"><a href="">mylink</a></div>')
|
||||
$parameters=array();
|
||||
$result=$hookmanager->executeHooks('printTopRightMenu',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
if (is_numeric($result))
|
||||
{
|
||||
if (empty($result)) $toprightmenu.=$hookmanager->resPrint; // add
|
||||
else $toprightmenu=$hookmanager->resPrint; // replace
|
||||
}
|
||||
else $toprightmenu.=$result; // For backward compatibility
|
||||
|
||||
// Link to module builder
|
||||
if (! empty($conf->modulebuilder->enabled))
|
||||
{
|
||||
$text ='<a href="'.DOL_URL_ROOT.'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_modulebuilder">';
|
||||
//$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
|
||||
$text.='<span class="fa fa-bug atoplogin"></span>';
|
||||
$text.='</a>';
|
||||
$toprightmenu.=@Form::textwithtooltip('',$langs->trans("ModuleBuilder"),2,1,$text,'login_block_elem',2);
|
||||
}
|
||||
|
||||
// Link to print main content area
|
||||
/*
|
||||
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && empty($conf->browser->phone))
|
||||
{
|
||||
$qs=dol_escape_htmltag($_SERVER["QUERY_STRING"]);
|
||||
|
||||
if (is_array($_POST))
|
||||
{
|
||||
foreach($_POST as $key=>$value) {
|
||||
if ($key!=='action' && $key!=='password' && !is_array($value)) $qs.='&'.$key.'='.urlencode($value);
|
||||
}
|
||||
}
|
||||
$qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
|
||||
$text ='<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">';
|
||||
//$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
|
||||
$text.='<span class="fa fa-print atoplogin"></span>';
|
||||
$text.='</a>';
|
||||
$toprightmenu.=@Form::textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2);
|
||||
}
|
||||
*/
|
||||
|
||||
// Link to Dolibarr wiki pages
|
||||
/*
|
||||
if (empty($conf->global->MAIN_HELP_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$langs->load("help");
|
||||
|
||||
$helpbaseurl='';
|
||||
$helppage='';
|
||||
$mode='';
|
||||
|
||||
if (empty($helppagename)) $helppagename='EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios';
|
||||
|
||||
// Get helpbaseurl, helppage and mode from helppagename and langs
|
||||
$arrayres=getHelpParamFor($helppagename,$langs);
|
||||
$helpbaseurl=$arrayres['helpbaseurl'];
|
||||
$helppage=$arrayres['helppage'];
|
||||
$mode=$arrayres['mode'];
|
||||
|
||||
// Link to help pages
|
||||
if ($helpbaseurl && $helppage)
|
||||
{
|
||||
$text='';
|
||||
$title=$appli.'<br>';
|
||||
$title.=$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage': 'GoToHelpPage');
|
||||
if ($mode == 'wiki') $title.=' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage,'_',' ')).'"';
|
||||
$text.='<a class="help" target="_blank" rel="noopener" href="';
|
||||
if ($mode == 'wiki') $text.=sprintf($helpbaseurl,urlencode(html_entity_decode($helppage)));
|
||||
else $text.=sprintf($helpbaseurl,$helppage);
|
||||
$text.='">';
|
||||
//$text.=img_picto('', 'helpdoc_top').' ';
|
||||
$text.='<span class="fa fa-question-circle atoplogin"></span>';
|
||||
//$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help');
|
||||
//if ($mode == 'wiki') $text.=' ('.dol_trunc(strtr($helppage,'_',' '),8).')';
|
||||
$text.='</a>';
|
||||
//$toprightmenu.='</div>'."\n";
|
||||
$toprightmenu.=@Form::textwithtooltip('',$title,2,1,$text,'login_block_elem',2);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Logout link
|
||||
if (GETPOST('withlogout','int')) $toprightmenu.=@Form::textwithtooltip('',$logouthtmltext,2,1,$logouttext,'login_block_elem',2);
|
||||
|
||||
$toprightmenu.='</div>';
|
||||
|
||||
print $toprightmenu;
|
||||
|
||||
print "</div>\n"; // end div class="login_block"
|
||||
|
||||
print '</div>';
|
||||
print '</body></html>'."\n";
|
||||
|
||||
$db->close();
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/core/get_menudiv.php
|
||||
* \brief File to return menu into a div tree
|
||||
* \brief File to return menu into a div tree, to be used by other frontend
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||
@ -37,8 +37,6 @@ if (! defined('DISABLE_JQUERY_TABLEDND')) define('DISABLE_JQUERY_TABLEDND',1);
|
||||
if (! defined('DISABLE_JQUERY_JNOTIFY')) define('DISABLE_JQUERY_JNOTIFY',1);
|
||||
if (! defined('DISABLE_JQUERY_FLOT')) define('DISABLE_JQUERY_FLOT',1);
|
||||
if (! defined('DISABLE_JQUERY_JEDITABLE')) define('DISABLE_JQUERY_JEDITABLE',1);
|
||||
if (! defined('DISABLE_JQUERY_JEDITABLE')) define('DISABLE_JQUERY_JEDITABLE',1);
|
||||
if (! defined('DISABLE_CKEDITOR')) define('DISABLE_CKEDITOR',1);
|
||||
if (! defined('DISABLE_CKEDITOR')) define('DISABLE_CKEDITOR',1);
|
||||
if (! defined('DISABLE_BROWSER_NOTIF')) define('DISABLE_BROWSER_NOTIF',1);
|
||||
if (! defined('DISABLE_DATE_PICKER')) define('DISABLE_DATE_PICKER',1);
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
* @param ChargeSociales $object Object related to tabs
|
||||
* @return array Array of tabs to show
|
||||
* @return array Array of tabs to show
|
||||
*/
|
||||
function tax_prepare_head(ChargeSociales $object)
|
||||
{
|
||||
@ -184,7 +184,6 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
|
||||
* Gets Tax to collect for the given year (and given quarter or month)
|
||||
* The function gets the Tax in split results, as the Tax declaration asks
|
||||
* to report the amounts for different Tax rates as different lines.
|
||||
* This function also accounts recurrent invoices.
|
||||
*
|
||||
* @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2'
|
||||
* @param DoliDB $db Database handler object
|
||||
@ -323,7 +322,7 @@ function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
if ($sql == 'TODO') return -2;
|
||||
if ($sql != 'TODO')
|
||||
{
|
||||
dol_syslog("Tax.lib.php::vat_by_date", LOG_DEBUG);
|
||||
dol_syslog("Tax.lib.php::tax_by_date", LOG_DEBUG);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -466,13 +465,13 @@ function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
|
||||
if (! $sql)
|
||||
{
|
||||
dol_syslog("Tax.lib.php::vat_by_date no accountancy module enabled".$sql,LOG_ERR);
|
||||
dol_syslog("Tax.lib.php::tax_by_date no accountancy module enabled".$sql,LOG_ERR);
|
||||
return -1; // -1 = Not accountancy module enabled
|
||||
}
|
||||
if ($sql == 'TODO') return -2; // -2 = Feature not yet available
|
||||
if ($sql != 'TODO')
|
||||
{
|
||||
dol_syslog("Tax.lib.php::vat_by_date", LOG_DEBUG);
|
||||
dol_syslog("Tax.lib.php::tax_by_date", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -565,13 +564,13 @@ function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
|
||||
if (! $sql)
|
||||
{
|
||||
dol_syslog("Tax.lib.php::vat_by_date no accountancy module enabled".$sql,LOG_ERR);
|
||||
dol_syslog("Tax.lib.php::tax_by_date no accountancy module enabled".$sql,LOG_ERR);
|
||||
return -1; // -1 = Not accountancy module enabled
|
||||
}
|
||||
if ($sql == 'TODO') return -2; // -2 = Feature not yet available
|
||||
if ($sql != 'TODO')
|
||||
{
|
||||
dol_syslog("Tax.lib.php::vat_by_date", LOG_DEBUG);
|
||||
dol_syslog("Tax.lib.php::tax_by_date", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -633,24 +632,3 @@ function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets VAT to collect for the given year (and given quarter or month)
|
||||
* The function gets the VAT in split results, as the VAT declaration asks
|
||||
* to report the amounts for different VAT rates as different lines.
|
||||
* This function also accounts recurrent invoices.
|
||||
*
|
||||
* @param DoliDB $db Database handler object
|
||||
* @param int $y Year
|
||||
* @param int $q Quarter
|
||||
* @param string $date_start Start date
|
||||
* @param string $date_end End date
|
||||
* @param int $modetax 0 or 1 (option vat on debit)
|
||||
* @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices)
|
||||
* @param int $m Month
|
||||
* @return array List of quarters with vat
|
||||
*/
|
||||
function vat_by_date ($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0)
|
||||
{
|
||||
return tax_by_date('vat', $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m);
|
||||
}
|
||||
|
||||
|
||||
@ -38,23 +38,78 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
*/
|
||||
class pdf_aurore extends ModelePDFSupplierProposal
|
||||
{
|
||||
var $db;
|
||||
var $name;
|
||||
var $description;
|
||||
var $type;
|
||||
/**
|
||||
* @var DoliDb Database handler
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* @var string model name
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* @var string model description (short text)
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* @var string document type
|
||||
*/
|
||||
public $type;
|
||||
|
||||
var $phpmin = array(4,3,0); // Minimum version of PHP required by module
|
||||
var $version = 'dolibarr';
|
||||
/**
|
||||
* @var array() Minimum version of PHP required by module.
|
||||
* e.g.: PHP ≥ 5.3 = array(5, 3)
|
||||
*/
|
||||
public $phpmin = array(5, 2);
|
||||
|
||||
/**
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
*/
|
||||
public $version = 'dolibarr';
|
||||
|
||||
var $page_largeur;
|
||||
var $page_hauteur;
|
||||
var $format;
|
||||
var $marge_gauche;
|
||||
var $marge_droite;
|
||||
var $marge_haute;
|
||||
var $marge_basse;
|
||||
/**
|
||||
* @var int page_largeur
|
||||
*/
|
||||
public $page_largeur;
|
||||
|
||||
/**
|
||||
* @var int page_hauteur
|
||||
*/
|
||||
public $page_hauteur;
|
||||
|
||||
/**
|
||||
* @var array format
|
||||
*/
|
||||
public $format;
|
||||
|
||||
/**
|
||||
* @var int marge_gauche
|
||||
*/
|
||||
public $marge_gauche;
|
||||
|
||||
/**
|
||||
* @var int marge_droite
|
||||
*/
|
||||
public $marge_droite;
|
||||
|
||||
/**
|
||||
* @var int marge_haute
|
||||
*/
|
||||
public $marge_haute;
|
||||
|
||||
/**
|
||||
* @var int marge_basse
|
||||
*/
|
||||
public $marge_basse;
|
||||
|
||||
var $emetteur; // Objet societe qui emet
|
||||
/**
|
||||
* Issuer
|
||||
* @var Societe
|
||||
*/
|
||||
public $emetteur;
|
||||
|
||||
|
||||
/**
|
||||
@ -62,9 +117,9 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
public function __construct($db)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
global $conf, $langs, $mysoc;
|
||||
|
||||
// Translations
|
||||
$langs->loadLangs(array("main", "bills"));
|
||||
@ -146,13 +201,9 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("supplier_proposal");
|
||||
$outputlangs->load("products");
|
||||
|
||||
// Translations
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "supplier_proposal"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
@ -1188,11 +1239,9 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("supplier_proposal");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
// Translations
|
||||
$outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies"));
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
|
||||
@ -440,7 +440,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
||||
if ($object->typeid > 0)
|
||||
{
|
||||
$membertype->fetch($object->typeid);
|
||||
$membertype->listMembersForMemberType();
|
||||
$membertype->listMembersForMemberType('', 1);
|
||||
|
||||
$oldinfo=$membertype->_load_ldap_info();
|
||||
$olddn=$membertype->_load_ldap_dn($oldinfo);
|
||||
@ -560,7 +560,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
||||
*/
|
||||
$newmembertype=new AdherentType($this->db);
|
||||
$newmembertype->fetch($object->typeid);
|
||||
$newmembertype->listMembersForMemberType();
|
||||
$newmembertype->listMembersForMemberType('', 1);
|
||||
|
||||
$oldinfo=$newmembertype->_load_ldap_info();
|
||||
$olddn=$newmembertype->_load_ldap_dn($oldinfo);
|
||||
@ -586,7 +586,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
||||
*/
|
||||
$oldmembertype=new AdherentType($this->db);
|
||||
$oldmembertype->fetch($object->oldcopy->typeid);
|
||||
$oldmembertype->listMembersForMemberType();
|
||||
$oldmembertype->listMembersForMemberType('', 1);
|
||||
|
||||
$oldinfo=$oldmembertype->_load_ldap_info();
|
||||
$olddn=$oldmembertype->_load_ldap_dn($oldinfo);
|
||||
@ -684,7 +684,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
||||
*/
|
||||
$membertype=new AdherentType($this->db);
|
||||
$membertype->fetch($object->typeid);
|
||||
$membertype->listMembersForMemberType('a.rowid != ' . $object->id); // remove deleted member from the list
|
||||
$membertype->listMembersForMemberType('a.rowid != ' . $object->id, 1); // remove deleted member from the list
|
||||
|
||||
$oldinfo=$membertype->_load_ldap_info();
|
||||
$olddn=$membertype->_load_ldap_dn($oldinfo);
|
||||
@ -751,7 +751,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
||||
$object->oldcopy = clone $object;
|
||||
}
|
||||
|
||||
$object->oldcopy->listMembersForMemberType();
|
||||
$object->oldcopy->listMembersForMemberType('', 1);
|
||||
|
||||
$oldinfo=$object->oldcopy->_load_ldap_info();
|
||||
$olddn=$object->oldcopy->_load_ldap_dn($oldinfo);
|
||||
@ -765,7 +765,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
||||
$olddn = '';
|
||||
}
|
||||
|
||||
$object->listMembersForMemberType();
|
||||
$object->listMembersForMemberType('', 1);
|
||||
|
||||
$info=$object->_load_ldap_info();
|
||||
$dn=$object->_load_ldap_dn($info);
|
||||
|
||||
@ -23,10 +23,8 @@
|
||||
|
||||
|
||||
/**
|
||||
* Define Common function to access calendar items
|
||||
* And format it in vCalendar
|
||||
* */
|
||||
|
||||
* Define Common function to access calendar items and format it in vCalendar
|
||||
*/
|
||||
class CdavLib
|
||||
{
|
||||
|
||||
@ -46,8 +44,9 @@ class CdavLib
|
||||
/**
|
||||
* Base sql request for calendar events
|
||||
*
|
||||
* @param int calendar user id
|
||||
* @param int actioncomm object id
|
||||
* @param int $calid Calendard id
|
||||
* @param int|boolean $oid Oid
|
||||
* @param int|boolean $ouri Ouri
|
||||
* @return string
|
||||
*/
|
||||
public function getSqlCalEvents($calid, $oid=false, $ouri=false)
|
||||
@ -113,14 +112,14 @@ class CdavLib
|
||||
/**
|
||||
* Convert calendar row to VCalendar string
|
||||
*
|
||||
* @param row object
|
||||
* @param int $calid Calendar id
|
||||
* @param Object $obj Object id
|
||||
* @return string
|
||||
*/
|
||||
public function toVCalendar($calid, $obj)
|
||||
{
|
||||
|
||||
$categ = [];
|
||||
/*if($obj->soc_client)
|
||||
/*$categ = array();
|
||||
if($obj->soc_client)
|
||||
{
|
||||
$nick[] = $obj->soc_code_client;
|
||||
$categ[] = $this->langs->transnoentitiesnoconv('Customer');
|
||||
@ -240,11 +239,17 @@ class CdavLib
|
||||
return $caldata;
|
||||
}
|
||||
|
||||
/**
|
||||
* getFullCalendarObjects
|
||||
*
|
||||
* @param int $calendarId Calendar id
|
||||
* @param int $bCalendarData Add calendar data
|
||||
* @return array|string[][]|unknown[][]|NULL[][]
|
||||
*/
|
||||
public function getFullCalendarObjects($calendarId, $bCalendarData)
|
||||
{
|
||||
|
||||
$calid = ($calendarId*1);
|
||||
$calevents = [] ;
|
||||
$calevents = array();
|
||||
|
||||
if(! $this->user->rights->agenda->myactions->read)
|
||||
return $calevents;
|
||||
@ -264,7 +269,7 @@ class CdavLib
|
||||
|
||||
if($bCalendarData)
|
||||
{
|
||||
$calevents[] = [
|
||||
$calevents[] = array(
|
||||
'calendardata' => $calendardata,
|
||||
'uri' => $obj->id.'-ev-'.CDAV_URI_KEY,
|
||||
'lastmodified' => strtotime($obj->lastupd),
|
||||
@ -272,11 +277,11 @@ class CdavLib
|
||||
'calendarid' => $calendarId,
|
||||
'size' => strlen($calendardata),
|
||||
'component' => strpos($calendardata, 'BEGIN:VEVENT')>0 ? 'vevent' : 'vtodo',
|
||||
];
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$calevents[] = [
|
||||
$calevents[] = array(
|
||||
// 'calendardata' => $calendardata, not necessary because etag+size are present
|
||||
'uri' => $obj->id.'-ev-'.CDAV_URI_KEY,
|
||||
'lastmodified' => strtotime($obj->lastupd),
|
||||
@ -284,7 +289,7 @@ class CdavLib
|
||||
'calendarid' => $calendarId,
|
||||
'size' => strlen($calendardata),
|
||||
'component' => strpos($calendardata, 'BEGIN:VEVENT')>0 ? 'vevent' : 'vtodo',
|
||||
];
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -484,7 +484,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
|
||||
$sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, SUM(l.qty) as qty,";
|
||||
$sql .= " p.ref, p.label, p.tobatch";
|
||||
$sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON l.fk_product=p.rowid";
|
||||
$sql .= " WHERE l.fk_commande = " . $object->id;
|
||||
@ -676,9 +676,9 @@ if ($id > 0 || ! empty($ref)) {
|
||||
// Warehouse
|
||||
print '<td align="right">';
|
||||
if (count($listwarehouses) > 1) {
|
||||
print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 1, 0, $objp->fk_product, '', 1);
|
||||
print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix)?GETPOST("entrepot" . $suffix):($objp->fk_default_warehouse?$objp->fk_default_warehouse:''), "entrepot" . $suffix, '', 1, 0, $objp->fk_product, '', 1);
|
||||
} elseif (count($listwarehouses) == 1) {
|
||||
print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 0, 0, $objp->fk_product, '', 1);
|
||||
print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix)?GETPOST("entrepot" . $suffix):($objp->fk_default_warehouse?$objp->fk_default_warehouse:''), "entrepot" . $suffix, '', 0, 0, $objp->fk_product, '', 1);
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
print $langs->trans("ErrorNoWarehouseDefined");
|
||||
|
||||
@ -271,7 +271,7 @@ $sql.= " s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.c
|
||||
$sql.= " typent.code as typent_code,";
|
||||
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql.= " country.code as country_code,";
|
||||
$sql.= " p.rowid as project_id, p.ref as project_ref";
|
||||
$sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
|
||||
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
|
||||
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
||||
if (! $search_all) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
||||
@ -925,6 +925,7 @@ if ($resql)
|
||||
{
|
||||
$projectstatic->id=$obj->project_id;
|
||||
$projectstatic->ref=$obj->project_ref;
|
||||
$projectstatic->title=$obj->project_label;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -39,6 +39,8 @@ ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFA
|
||||
DROP TABLE llx_c_accountancy_category;
|
||||
DROP TABLE llx_c_accountingaccount;
|
||||
|
||||
update llx_propal set fk_statut = 1 where fk_statut = -1;
|
||||
|
||||
|
||||
-- For 8.0
|
||||
|
||||
@ -297,12 +299,12 @@ CREATE TABLE llx_societe_account(
|
||||
ALTER TABLE llx_const MODIFY type varchar(64) DEFAULT 'string';
|
||||
|
||||
UPDATE llx_const set type = 'text' where type = 'texte';
|
||||
UPDATE llx_const set type = 'html' where name in ('ADHERENT_AUTOREGISTER_NOTIF_MAIL','ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL');
|
||||
UPDATE llx_const set type = 'html' where name in (__ENCRYPT('ADHERENT_AUTOREGISTER_NOTIF_MAIL')__,__ENCRYPT('ADHERENT_AUTOREGISTER_MAIL')__,__ENCRYPT('ADHERENT_MAIL_VALID')__,__ENCRYPT('ADHERENT_MAIL_COTIS')__,__ENCRYPT('ADHERENT_MAIL_RESIL')__);
|
||||
|
||||
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_AUTOREGISTER_MAIL' AND type != 'emailtemplate:member';
|
||||
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_VALID' AND type != 'emailtemplate:member';
|
||||
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_COTIS' AND type != 'emailtemplate:member';
|
||||
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_RESIL' AND type != 'emailtemplate:member';
|
||||
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = __ENCRYPT('ADHERENT_AUTOREGISTER_MAIL')__ AND type != 'emailtemplate:member';
|
||||
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = __ENCRYPT('ADHERENT_MAIL_VALID')__ AND type != 'emailtemplate:member';
|
||||
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = __ENCRYPT('ADHERENT_MAIL_COTIS')__ AND type != 'emailtemplate:member';
|
||||
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = __ENCRYPT('ADHERENT_MAIL_RESIL')__ AND type != 'emailtemplate:member';
|
||||
|
||||
ALTER TABLE llx_societe_account ADD COLUMN key_account varchar(128);
|
||||
|
||||
@ -329,3 +331,7 @@ INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_u
|
||||
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfSubscriptionReminderEmail)__<br>\n<br>__ONLINE_PAYMENT_TEXT_AND_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
|
||||
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(YourMembershipWasCanceled)__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
|
||||
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br>\n__(Lastname)__ : __MEMBER_LASTNAME__<br>\n__(Fullname)__ : __MEMBER_FULLNAME__<br>\n__(Company)__ : __MEMBER_COMPANY__<br>\n__(Address)__ : __MEMBER_ADDRESS__<br>\n__(Zip)__ : __MEMBER_ZIP__<br>\n__(Town)__ : __MEMBER_TOWN__<br>\n__(Country)__ : __MEMBER_COUNTRY__<br>\n__(Email)__ : __MEMBER_EMAIL__<br>\n__(Birthday)__ : __MEMBER_BIRTH__<br>\n__(Photo)__ : __MEMBER_PHOTO__<br>\n__(Login)__ : __MEMBER_LOGIN__<br>\n__(Password)__ : __MEMBER_PASSWORD__<br>\n__(Phone)__ : __MEMBER_PHONE__<br>\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br>\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
|
||||
|
||||
ALTER TABLE llx_product ADD COLUMN fk_default_warehouse integer DEFAULT NULL;
|
||||
ALTER TABLE llx_product ADD CONSTRAINT fk_product_default_warehouse FOREIGN KEY (fk_default_warehouse) REFERENCES llx_entrepot (rowid);
|
||||
|
||||
|
||||
@ -348,6 +348,8 @@ update llx_facturedet set product_type = 1 where product_type = 2;
|
||||
--update llx_commandedet as d set d.product_type = 1 where d.fk_product = 22 and d.product_type = 0;
|
||||
--update llx_facturedet as d set d.product_type = 1 where d.fk_product = 22 and d.product_type = 0;
|
||||
|
||||
update llx_propal set fk_statut = 1 where fk_statut = -1;
|
||||
|
||||
delete from llx_commande_fournisseur_dispatch where fk_commandefourndet = 0 or fk_commandefourndet IS NULL;
|
||||
|
||||
|
||||
|
||||
@ -35,3 +35,4 @@ ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_unit FOREIGN KEY (fk_unit)
|
||||
|
||||
ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_country (rowid);
|
||||
ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid);
|
||||
ALTER TABLE llx_product ADD CONSTRAINT fk_product_default_warehouse FOREIGN KEY (fk_default_warehouse) REFERENCES llx_entrepot (rowid);
|
||||
|
||||
@ -85,6 +85,7 @@ create table llx_product
|
||||
pmp double(24,8) DEFAULT 0 NOT NULL, -- To store valuation of stock calculated using average price method, for this product
|
||||
fifo double(24,8), -- To store valuation of stock calculated using fifo method, for this product. TODO Not used, should be replaced by stock value stored into movement table.
|
||||
lifo double(24,8), -- To store valuation of stock calculated using lifo method, for this product. TODO Not used, should be replaced by stock value stored into movement table.
|
||||
fk_default_warehouse integer DEFAULT NULL,
|
||||
canvas varchar(32) DEFAULT NULL,
|
||||
finished tinyint DEFAULT NULL, -- 1=manufactured product, 0=matiere premiere
|
||||
hidden tinyint DEFAULT 0, -- Not used. Deprecated.
|
||||
|
||||
@ -8,7 +8,9 @@ WarehouseEdit=Modify warehouse
|
||||
MenuNewWarehouse=New warehouse
|
||||
WarehouseSource=Source warehouse
|
||||
WarehouseSourceNotDefined=No warehouse defined,
|
||||
AddWarehouse=Create warehouse
|
||||
AddOne=Add one
|
||||
DefaultWarehouse=Default warehouse
|
||||
WarehouseTarget=Target warehouse
|
||||
ValidateSending=Delete sending
|
||||
CancelSending=Cancel sending
|
||||
|
||||
@ -52,6 +52,7 @@ TypeContact_ticketsup_internal_SUPPORTTEC=Assigned user
|
||||
TypeContact_ticketsup_external_SUPPORTCLI=Customer contact / incident tracking
|
||||
TypeContact_ticketsup_external_CONTRIBUTOR=External contributor
|
||||
|
||||
OriginEmail=Email source
|
||||
Notify_TICKETMESSAGE_SENTBYMAIL=Send ticket answer by email
|
||||
|
||||
# Status
|
||||
|
||||
@ -85,6 +85,10 @@ EmployeeFirstname=Prénom du salarié
|
||||
TypeWasDisabledOrRemoved=Le type de congés (id %s) a été désactivé ou supprimé
|
||||
LastHolidays=Les %s dernières demandes de congés
|
||||
AllHolidays=Toutes les demandes de congés
|
||||
LEAVE_PAID=Congé payés
|
||||
LEAVE_SICK=Arrêt maladie
|
||||
LEAVE_OTHER=Autre congé
|
||||
LEAVE_PAID_FR=congé payés
|
||||
|
||||
## Configuration du Module ##
|
||||
LastUpdateCP=Dernière mise à jour automatique de l'allocation des congés
|
||||
|
||||
@ -1116,12 +1116,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
|
||||
if (empty($conf->css)) $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default
|
||||
|
||||
if (! empty($conf->global->MAIN_ACTIVATE_HTML4)) {
|
||||
$doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||
}else {
|
||||
$doctype = '<!doctype html>';
|
||||
}
|
||||
print $doctype."\n";
|
||||
print '<!doctype html>'."\n";
|
||||
|
||||
if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print '<html lang="'.substr($langs->defaultlang,0,2).'" manifest="'.DOL_URL_ROOT.'/cache.manifest">'."\n";
|
||||
else print '<html lang="'.substr($langs->defaultlang,0,2).'">'."\n";
|
||||
//print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n";
|
||||
@ -1572,7 +1568,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
|
||||
print $toprightmenu;
|
||||
|
||||
print "</div>\n";
|
||||
print "</div>\n"; // end div class="login_block"
|
||||
|
||||
print '</div></div>';
|
||||
|
||||
//unset($form);
|
||||
|
||||
@ -292,6 +292,7 @@ if (empty($reshook))
|
||||
$object->country_id = GETPOST('country_id');
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
$object->fk_default_warehouse = GETPOST('fk_default_warehouse');
|
||||
$object->seuil_stock_alerte = GETPOST('seuil_stock_alerte')?GETPOST('seuil_stock_alerte'):0;
|
||||
$object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0;
|
||||
$object->canvas = GETPOST('canvas');
|
||||
@ -390,6 +391,7 @@ if (empty($reshook))
|
||||
$object->status_buy = GETPOST('statut_buy');
|
||||
$object->status_batch = GETPOST('status_batch');
|
||||
// removed from update view so GETPOST always empty
|
||||
$object->fk_default_warehouse = GETPOST('fk_default_warehouse');
|
||||
/*
|
||||
$object->seuil_stock_alerte = GETPOST('seuil_stock_alerte');
|
||||
$object->desiredstock = GETPOST('desiredstock');
|
||||
@ -995,9 +997,14 @@ else
|
||||
print '<input type="text" name="url" class="quatrevingtpercent" value="'.GETPOST('url').'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Stock min level
|
||||
if ($type != 1 && ! empty($conf->stock->enabled))
|
||||
{
|
||||
// Default warehouse
|
||||
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
|
||||
print $formproduct->selectWarehouses(GETPOST('fk_default_warehouse'), 'fk_default_warehouse', 'warehouseopen', 1);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit').'">'.$langs->trans("AddWarehouse").'</a>';
|
||||
print '</td>';
|
||||
// Stock min level
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).'</td><td>';
|
||||
print '<input name="seuil_stock_alerte" class="maxwidth50" value="'.GETPOST('seuil_stock_alerte').'">';
|
||||
print '</td>';
|
||||
@ -1351,9 +1358,14 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Stock
|
||||
/*
|
||||
if ($object->isProduct() && ! empty($conf->stock->enabled))
|
||||
{
|
||||
// Default warehouse
|
||||
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
|
||||
print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].'?action=create&type='.GETPOST('type', 'int')).'">'.$langs->trans("AddWarehouse").'</a>';
|
||||
print '</td>';
|
||||
/*
|
||||
print "<tr>".'<td>'.$langs->trans("StockLimit").'</td><td>';
|
||||
print '<input name="seuil_stock_alerte" size="4" value="'.$object->seuil_stock_alerte.'">';
|
||||
print '</td>';
|
||||
@ -1361,7 +1373,9 @@ else
|
||||
print '<td>'.$langs->trans("DesiredStock").'</td><td>';
|
||||
print '<input name="desiredstock" size="4" value="'.$object->desiredstock.'">';
|
||||
print '</td></tr>';
|
||||
*/
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
print '<input name="seuil_stock_alerte" type="hidden" value="'.$object->seuil_stock_alerte.'">';
|
||||
@ -1757,6 +1771,17 @@ else
|
||||
print dol_print_url($object->url);
|
||||
print '</td></tr>';
|
||||
|
||||
// Default warehouse
|
||||
if ($object->isProduct() && ! empty($conf->stock->enabled))
|
||||
{
|
||||
$warehouse = new Entrepot($db);
|
||||
$warehouse->fetch($object->fk_default_warehouse);
|
||||
|
||||
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
|
||||
print (! empty($warehouse->id) ? $warehouse->getNomUrl(1) : '');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
//Parent product.
|
||||
if (!empty($conf->variants->enabled) && $object->isProduct()) {
|
||||
|
||||
|
||||
@ -886,6 +886,7 @@ class Product extends CommonObject
|
||||
$sql.= ", surface_units = " . ($this->surface_units!='' ? "'".$this->db->escape($this->surface_units)."'" : 'null');
|
||||
$sql.= ", volume = " . ($this->volume!='' ? "'".$this->db->escape($this->volume)."'" : 'null');
|
||||
$sql.= ", volume_units = " . ($this->volume_units!='' ? "'".$this->db->escape($this->volume_units)."'" : 'null');
|
||||
$sql.= ", fk_default_warehouse = " . (! empty($this->fk_default_warehouse) ? $this->db->escape($this->fk_default_warehouse) : 'null');
|
||||
$sql.= ", seuil_stock_alerte = " . ((isset($this->seuil_stock_alerte) && $this->seuil_stock_alerte != '') ? "'".$this->db->escape($this->seuil_stock_alerte)."'" : "null");
|
||||
$sql.= ", description = '" . $this->db->escape($this->description) ."'";
|
||||
$sql.= ", url = " . ($this->url?"'".$this->db->escape($this->url)."'":'null');
|
||||
@ -1864,7 +1865,7 @@ class Product extends CommonObject
|
||||
|
||||
$sql = "SELECT rowid, ref, ref_ext, label, description, url, note as note_private, customcode, fk_country, price, price_ttc,";
|
||||
$sql.= " price_min, price_min_ttc, price_base_type, cost_price, default_vat_code, tva_tx, recuperableonly as tva_npr, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, tosell,";
|
||||
$sql.= " tobuy, fk_product_type, duration, seuil_stock_alerte, canvas, weight, weight_units,";
|
||||
$sql.= " tobuy, fk_product_type, duration, fk_default_warehouse, seuil_stock_alerte, canvas, weight, weight_units,";
|
||||
$sql.= " length, length_units, width, width_units, height, height_units,";
|
||||
$sql.= " surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,";
|
||||
$sql.= " accountancy_code_buy, accountancy_code_sell, accountancy_code_sell_intra, accountancy_code_sell_export, stock, pmp,";
|
||||
@ -1946,6 +1947,7 @@ class Product extends CommonObject
|
||||
$this->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra;
|
||||
$this->accountancy_code_sell_export = $obj->accountancy_code_sell_export;
|
||||
|
||||
$this->fk_default_warehouse = $obj->fk_default_warehouse;
|
||||
$this->seuil_stock_alerte = $obj->seuil_stock_alerte;
|
||||
$this->desiredstock = $obj->desiredstock;
|
||||
$this->stock_reel = $obj->stock;
|
||||
|
||||
@ -70,7 +70,7 @@ if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td>';
|
||||
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
|
||||
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
|
||||
print ' <select name="mouvement" id="mouvement">';
|
||||
print '<option value="0">'.$langs->trans("Add").'</option>';
|
||||
print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>';
|
||||
|
||||
@ -74,7 +74,7 @@ if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>';
|
||||
print '<td>';
|
||||
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):'ifone')), 'id_entrepot', 'warehouseopen,warehouseinternal', 1);
|
||||
print $formproduct->selectWarehouses((GETPOST("dwid")?GETPOST("dwid",'int'):(GETPOST('id_entrepot')?GETPOST('id_entrepot','int'):($object->element=='product' && $object->fk_default_warehouse?$object->fk_default_warehouse:'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1);
|
||||
print '</td>';
|
||||
}
|
||||
if ($object->element == 'stock')
|
||||
|
||||
@ -66,7 +66,7 @@ $extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('thirdpartycard','globalcard'));
|
||||
$hookmanager->initHooks(array('thirdpartycontact','globalcard'));
|
||||
|
||||
if ($action == 'view' && $object->fetch($socid)<=0)
|
||||
{
|
||||
|
||||
@ -1939,6 +1939,16 @@ div.login_block_other { padding-top: 3px; text-align: right; }
|
||||
color: #<?php echo $colortextbackhmenu; ?> !important;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
.login_block_getinfo {
|
||||
text-align: center;
|
||||
}
|
||||
.login_block_getinfo div.login_block_user {
|
||||
display: block;
|
||||
}
|
||||
.login_block_getinfo .atoplogin, .login_block_getinfo .atoplogin:hover {
|
||||
color: #333 !important;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
.alogin, .alogin:hover {
|
||||
font-weight: normal !important;
|
||||
font-size: <?php echo $fontsizesmaller; ?>px !important;
|
||||
|
||||
@ -1201,6 +1201,16 @@ div.login_block {
|
||||
/* position: initial !important;*/
|
||||
display: none;
|
||||
}
|
||||
.login_block_getinfo {
|
||||
text-align: center;
|
||||
}
|
||||
.login_block_getinfo div.login_block_user {
|
||||
display: block;
|
||||
}
|
||||
.login_block_getinfo .atoplogin, .login_block_getinfo .atoplogin:hover {
|
||||
color: #333 !important;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
#id-right {
|
||||
padding-left: 0 ! important;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ if (!empty($conf->projet->enabled)) {
|
||||
}
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("ticketsup","companies","other"));
|
||||
$langs->loadLangs(array("ticketsup","companies","other","projects"));
|
||||
|
||||
|
||||
// Get parameters
|
||||
@ -49,10 +49,11 @@ $backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated
|
||||
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
|
||||
$msg_id = GETPOST('msg_id', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$projectid = GETPOST('projectid', 'int');
|
||||
$search_fk_soc=GETPOST('$search_fk_soc','int')?GETPOST('$search_fk_soc','int'):GETPOST('socid','int');
|
||||
$search_fk_project=GETPOST('search_fk_project','int')?GETPOST('search_fk_project','int'):GETPOST('projectid','int');
|
||||
$search_fk_status = GETPOST('search_fk_status', 'alpha');
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
|
||||
@ -112,19 +113,10 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
}
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
//if ($socid > 0) $arrayfields['t.fk_soc']['enabled']=0;
|
||||
//if ($projectid > 0) $arrayfields['t.fk_project']['enabled']=0;
|
||||
|
||||
|
||||
// Filters
|
||||
// $search_soc = GETPOST("search_soc");
|
||||
// $search_fk_status = GETPOST("search_fk_status", 'alpha');
|
||||
// $search_subject = GETPOST("search_subject");
|
||||
// $search_type = GETPOST("search_type", 'alpha');
|
||||
// $search_category = GETPOST("search_category", 'alpha');
|
||||
// $search_severity = GETPOST("search_severity", 'alpha');
|
||||
// $search_project = GETPOST("search_project", 'int');
|
||||
// $search_fk_user_create = GETPOST("search_fk_user_create", 'int');
|
||||
// $search_fk_user_assign = GETPOST("search_fk_user_assign", 'int');
|
||||
|
||||
// Security check
|
||||
if (!$user->rights->ticketsup->read) {
|
||||
accessforbidden();
|
||||
@ -218,7 +210,8 @@ foreach($search as $key => $val)
|
||||
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'fk_statut')?2:$mode_search));
|
||||
}
|
||||
if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
|
||||
if ($search_fk_soc) $sql.= natural_search('fk_soc', $search_fk_soc);
|
||||
if ($search_fk_project) $sql.= natural_search('fk_project', $search_fk_project);
|
||||
if (!$user->societe_id && ($mode == "my_assign" || (!$user->admin && $conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY))) {
|
||||
$sql.= " AND t.fk_user_assign=".$user->id;
|
||||
}
|
||||
@ -336,11 +329,14 @@ if ($socid && !$projectid && $user->rights->societe->lire) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($projectid) {
|
||||
if ($projectid > 0) {
|
||||
$projectstat = new Project($db);
|
||||
if ($projectstat->fetch($projectid) > 0) {
|
||||
$projectstat->fetch_thirdparty();
|
||||
|
||||
$savobject = $object;
|
||||
$object = $projectstat;
|
||||
|
||||
// To verify role of users
|
||||
//$userAccess = $object->restrictedProjectArea($user,'read');
|
||||
$userWrite = $projectstat->restrictedProjectArea($user, 'write');
|
||||
@ -348,55 +344,52 @@ if ($projectid) {
|
||||
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
|
||||
|
||||
$head = project_prepare_head($projectstat);
|
||||
dol_fiche_head($head, 'ticketsup', $langs->trans("Project"), 0, ($projectstat->public ? 'projectpub' : 'project'));
|
||||
dol_fiche_head($head, 'ticketsup', $langs->trans("Project"), -1, ($projectstat->public ? 'projectpub' : 'project'));
|
||||
|
||||
// Project card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Title
|
||||
$morehtmlref.=$object->title;
|
||||
// Thirdparty
|
||||
if ($object->thirdparty->id > 0)
|
||||
{
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (! $user->rights->projet->all->lire)
|
||||
{
|
||||
$objectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
|
||||
$object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
|
||||
}
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
/*
|
||||
* Projet synthese pour rappel
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/projet/list.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield">' . $langs->trans('Ref') . '</td><td>';
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (!$user->rights->projet->all->lire) {
|
||||
$objectsListId = $projectstat->getProjectsAuthorizedForUser($user, $mine, 0);
|
||||
$projectstat->next_prev_filter = " rowid in (" . (count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")";
|
||||
}
|
||||
print $form->showrefnav($projectstat, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td><td>' . $projectstat->title . '</td></tr>';
|
||||
|
||||
// Customer
|
||||
print "<tr><td>" . $langs->trans("ThirdParty") . "</td>";
|
||||
print '<td>';
|
||||
if ($projectstat->thirdparty->id > 0) {
|
||||
print $projectstat->thirdparty->getNomUrl(1);
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>' . $langs->trans("Visibility") . '</td><td>';
|
||||
print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
|
||||
if ($projectstat->public) {
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>' . $langs->trans("Status") . '</td><td>' . $projectstat->getLibStatut(4) . '</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
dol_fiche_end();
|
||||
|
||||
$object = $savobject;
|
||||
|
||||
} else {
|
||||
print "ErrorRecordNotFound";
|
||||
}
|
||||
@ -414,6 +407,8 @@ foreach($search as $key => $val)
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
if ($socid) $param.='&socid='.urlencode($socid);
|
||||
if ($projectid) $param.='&projectid='.urlencode($projectid);
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
@ -435,6 +430,8 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="' . $mode . '" >';
|
||||
if ($socid) print '<input type="hidden" name="socid" value="' . $socid . '" >';
|
||||
if ($projectid) print '<input type="hidden" name="projectid" value="' . $projectid . '" >';
|
||||
|
||||
$buttontocreate = '<a class="butAction" href="new.php?action=create_ticket' . ($socid ? '&socid=' . $socid : '') . ($projectid ? '&origin=projet_project&originid=' . $projectid : '') . '">' . $langs->trans('NewTicket') . '</a>';
|
||||
|
||||
@ -456,7 +453,6 @@ if ($sall)
|
||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||
}
|
||||
|
||||
|
||||
if ($search_fk_status == 'non_closed') {
|
||||
print '<div><a href="' . $url_page_current . '?search_fk_status=-1' . ($socid ? '&socid=' . $socid : '') . '">' . $langs->trans('TicketViewAllTickets') . '</a></div>';
|
||||
$param .= '&search_fk_status=non_closed';
|
||||
@ -591,24 +587,24 @@ while ($i < min($num, $limit))
|
||||
print '<tr class="oddeven">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
||||
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||
{
|
||||
print '<td';
|
||||
if ($align) print ' class="'.$align.'"';
|
||||
print '>';
|
||||
print $object->showOutputField($val, $key, $obj->$key, '');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! empty($val['isameasure']))
|
||||
{
|
||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key;
|
||||
$totalarray['val']['t.'.$key] += $obj->$key;
|
||||
}
|
||||
}
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||
if ($key == 'status') $align.=($align?' ':'').'center';
|
||||
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||
{
|
||||
print '<td';
|
||||
if ($align) print ' class="'.$align.'"';
|
||||
print '>';
|
||||
print $object->showOutputField($val, $key, $obj->$key, '');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! empty($val['isameasure']))
|
||||
{
|
||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key;
|
||||
$totalarray['val']['t.'.$key] += $obj->$key;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
|
||||
@ -2109,7 +2109,7 @@ class User extends CommonObject
|
||||
*
|
||||
* @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
|
||||
* @param string $option On what the link point to ('leave', 'nolink', )
|
||||
* @param integer $infologin Add complete info tooltip
|
||||
* @param integer $infologin 0=Add default info tooltip, 1=Add complete info tooltip, -1=No info tooltip
|
||||
* @param integer $notooltip 1=Disable tooltip on picto and name
|
||||
* @param int $maxlen Max length of visible user name
|
||||
* @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user
|
||||
@ -2136,6 +2136,7 @@ class User extends CommonObject
|
||||
$label.= '</div><div style="clear: both;"></div>';
|
||||
}
|
||||
|
||||
// Info Login
|
||||
$label.= '<div class="centpercent">';
|
||||
$label.= '<u>' . $langs->trans("User") . '</u><br>';
|
||||
$label.= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'');
|
||||
@ -2144,20 +2145,18 @@ class User extends CommonObject
|
||||
$label.= '<br><b>' . $langs->trans("EMail").':</b> '.$this->email;
|
||||
if (! empty($this->admin))
|
||||
$label.= '<br><b>' . $langs->trans("Administrator").'</b>: '.yn($this->admin);
|
||||
if (! empty($this->societe_id) ) // Add thirdparty for external users
|
||||
if (! empty($this->socid) ) // Add thirdparty for external users
|
||||
{
|
||||
$thirdpartystatic = new Societe($db);
|
||||
$thirdpartystatic->fetch($this->societe_id);
|
||||
$thirdpartystatic->fetch($this->socid);
|
||||
if (empty($hidethirdpartylogo)) $companylink = ' '.$thirdpartystatic->getNomUrl(2, (($option == 'nolink')?'nolink':'')); // picto only of company
|
||||
$company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')';
|
||||
}
|
||||
$type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
|
||||
$type=($this->socid?$langs->trans("External").$company:$langs->trans("Internal"));
|
||||
$label.= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type;
|
||||
$label.= '<br><b>' . $langs->trans("Status").'</b>: '.$this->getLibStatut(0);
|
||||
$label.='</div>';
|
||||
|
||||
// Info Login
|
||||
if ($infologin)
|
||||
if ($infologin > 0)
|
||||
{
|
||||
$label.= '<br>';
|
||||
$label.= '<br><u>'.$langs->trans("Connection").'</u>';
|
||||
@ -2176,6 +2175,7 @@ class User extends CommonObject
|
||||
if (! empty($conf->browser->phone)) $label.= '<br><b>'.$langs->trans("Phone").':</b> '.$conf->browser->phone;
|
||||
if (! empty($_SESSION["disablemodules"])) $label.= '<br><b>'.$langs->trans("DisabledModules").':</b> <br>'.join(', ',explode(',',$_SESSION["disablemodules"]));
|
||||
}
|
||||
if ($infologin < 0) $label='';
|
||||
|
||||
$url = DOL_URL_ROOT.'/user/card.php?id='.$this->id;
|
||||
if ($option == 'leave') $url = DOL_URL_ROOT.'/holiday/list.php?id='.$this->id;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user