Fix translation and sql request
This commit is contained in:
parent
86e5465197
commit
db32ca99c6
@ -1039,8 +1039,8 @@ else
|
||||
print '<tr><td>'.$langs->trans("LinkedIn").'</td><td><input type="text" name="member_linkedin" size="40" value="'.(GETPOST('member_linkedin', 'alpha')?GETPOST('member_linkedin', 'alpha'):$object->linkedin).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
// Birth Date
|
||||
print "<tr><td>".$langs->trans("DateToBirth")."</td><td>\n";
|
||||
print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc');
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -1308,8 +1308,8 @@ else
|
||||
print '<tr><td>'.$langs->trans("LinkedIn").'</td><td><input type="text" name="linkedin" class="minwidth100" value="'.(isset($_POST["linkedin"])?GETPOST("linkedin"):$object->linkedin).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
// Birth Date
|
||||
print "<tr><td>".$langs->trans("DateToBirth")."</td><td>\n";
|
||||
print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc');
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -1750,8 +1750,8 @@ else
|
||||
|
||||
print '<table class="border tableforfield tableforfield" width="100%">';
|
||||
|
||||
// Birthday
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||
// Birth Date
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DateToBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||
|
||||
// Public
|
||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||
|
||||
@ -34,7 +34,7 @@ class box_birthdays extends ModeleBoxes
|
||||
{
|
||||
public $boxcode="birthdays";
|
||||
public $boximg="object_user";
|
||||
public $boxlabel="BoxBirthdays";
|
||||
public $boxlabel="BoxTitleUserBirthdaysOfMonth";
|
||||
public $depends = array("user");
|
||||
|
||||
/**
|
||||
@ -76,18 +76,20 @@ class box_birthdays extends ModeleBoxes
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
$userstatic=new User($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleUserBirthdaysOfMonth"));
|
||||
|
||||
if ($user->rights->user->user->lire)
|
||||
{
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname";
|
||||
$sql.= ", u.birth";
|
||||
$tmparray=dol_getdate(dol_now(), true);
|
||||
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql.= " AND MONTH(u.birth) = ".date('m');
|
||||
$sql.= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], $tmparray['year']);
|
||||
$sql.= " ORDER BY u.birth ASC";
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
@ -127,7 +129,7 @@ class box_birthdays extends ModeleBoxes
|
||||
$line++;
|
||||
}
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedUsers"));
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center opacitymedium"','text'=>$langs->trans("None"));
|
||||
|
||||
$this->db->free($result);
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ class box_birthdays_members extends ModeleBoxes
|
||||
{
|
||||
public $boxcode="birthdays_members";
|
||||
public $boximg="object_user";
|
||||
public $boxlabel="BoxBirthdaysMembers";
|
||||
public $boxlabel="BoxTitleMemberNextBirthdays";
|
||||
public $depends = array("adherent");
|
||||
|
||||
/**
|
||||
@ -76,20 +76,22 @@ class box_birthdays_members extends ModeleBoxes
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$memberstatic=new Adherent($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleMemberNextBirthdays"));
|
||||
|
||||
if ($user->rights->adherent->lire)
|
||||
{
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname";
|
||||
$sql.= ", u.birth";
|
||||
$tmparray=dol_getdate(dol_now(), true);
|
||||
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as u";
|
||||
$sql.= " WHERE u.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " AND u.statut = 1";
|
||||
$sql.= " AND date_format(u.birth, '%m-%d') >= date_format(curdate(), '%m-%d')";
|
||||
$sql.= " ORDER BY date_format(u.birth, '%m-%d') ASC";
|
||||
$sql.= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], $tmparray['year']);
|
||||
$sql.= " ORDER BY u.birth ASC";
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
@ -128,7 +130,7 @@ class box_birthdays_members extends ModeleBoxes
|
||||
$line++;
|
||||
}
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedUsers"));
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center opacitymedium"','text'=>$langs->trans("None"));
|
||||
|
||||
$this->db->free($result);
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ BoxLastContacts=Latest contacts/addresses
|
||||
BoxLastMembers=Latest members
|
||||
BoxFicheInter=Latest interventions
|
||||
BoxCurrentAccounts=Open accounts balance
|
||||
BoxTitleMemberNextBirthdays=Birthdays of this month (members)
|
||||
BoxTitleLastRssInfos=Latest %s news from %s
|
||||
BoxTitleLastProducts=Products/Services: last %s modified
|
||||
BoxTitleProductsAlertStock=Products: stock alert
|
||||
@ -85,4 +86,4 @@ ForProposals=Proposals
|
||||
LastXMonthRolling=The latest %s month rolling
|
||||
ChooseBoxToAdd=Add widget to your dashboard
|
||||
BoxAdded=Widget was added in your dashboard
|
||||
BoxTitleUserBirthdaysOfMonth=Birthdays of this month
|
||||
BoxTitleUserBirthdaysOfMonth=Birthdays of this month (users)
|
||||
@ -6,7 +6,7 @@ TMenuTools=Tools
|
||||
ToolsDesc=All tools not included in other menu entries are grouped here.<br>All the tools can be accessed via the left menu.
|
||||
Birthday=Birthday
|
||||
BirthdayDate=Birthday date
|
||||
DateToBirth=Date of birth
|
||||
DateToBirth=Birth date
|
||||
BirthdayAlertOn=birthday alert active
|
||||
BirthdayAlertOff=birthday alert inactive
|
||||
TransKey=Translation of the key TransKey
|
||||
|
||||
@ -240,6 +240,7 @@ foreach($search as $key => $val)
|
||||
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search));
|
||||
}
|
||||
if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
|
||||
Loading…
Reference in New Issue
Block a user