Merge remote-tracking branch 'Upstream/develop' into develop-42

This commit is contained in:
aspangaro 2015-06-29 06:45:24 +02:00
commit 768042513d
1498 changed files with 43488 additions and 19133 deletions

View File

@ -34,6 +34,7 @@ For translators:
For developers:
- New: Function yn can show a visual checkbox.
- New: Introduced select2 jquery plugin.
- New: Possibility to add javascript in main login page with "getLoginPageOptions" hook
WARNING: Following changes may create regression for some external modules, but was necessary to make
Dolibarr better:
@ -42,8 +43,9 @@ Dolibarr better:
- Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook development rules. They are
"addreplace" hooks, so you must return content with "->resprints='mycontent'" and not with "return 'mycontent'"
- All fields "fk_societe" were renamed into "fk_soc".
- Method select_PriceBaseType and load_PriceBaseType were merged into selectPriceBaseType
- Method select_PriceBaseType and load_PriceBaseType were merged into selectPriceBaseType.
- The trigger USER_LOGIN* are deprecated. They are still working but you should prefer use the
hook afterLogin or afterLoginFailed instead.
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX [ bug #2855 ] Wrong translation key in localtax report page

View File

@ -38,6 +38,15 @@ filter-pristine-tar = True
END
# Complete .bashrc with DEBEMAIL and DEBFULLNAME
Example:
export DEBFULLNAME="Laurent Destailleur (eldy)"
export DEBEMAIL=eldy@users.sourceforge.net
Other example:
export DEBFULLNAME="Laurent Destailleur"
export DEBEMAIL="eldy@destailleur.fr"
# To use Alioth.debian.org
* Create an account login
* Update your ~/.ssh/config file to add:
@ -111,7 +120,7 @@ severity 123 xxx
##### Update but tracker system
To set status of a bug to "pending"
> bts tag 999999 +pending
> bts --smtp-host=yoursmtpserver tag 999999 +pending
or replay to email 999999@bugs.debian.org + submitter of bug
With a message starting with:

View File

@ -455,13 +455,15 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
# Removed known external modules to avoid any error when packaging from env where external modules are tested
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom/*`; # For custom we want to keep dir
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;

1
htdocs/.gitignore vendored
View File

@ -10,3 +10,4 @@
/ovh*
/pos
/ultimatepdf*
/lead

View File

@ -295,8 +295,8 @@ else
print_liste_field_titre($langs->trans("Credit"));
print_liste_field_titre($langs->trans("Amount"));
print_liste_field_titre($langs->trans("Sens"));
print '<td></td>';
print_liste_field_titre('');
print "</tr>\n";
foreach ( $book->linesmvt as $line ) {

View File

@ -90,7 +90,7 @@ if ($resql) {
print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("&nbsp;");
print_liste_field_titre('');
print "</tr>\n";
$var = True;

View File

@ -34,9 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$langs->load("companies");
@ -239,7 +240,7 @@ if (empty($reshook))
}
}
if ($action == 'update' && $cancel='' && $user->rights->adherent->creer)
if ($action == 'update' && ! $cancel && $user->rights->adherent->creer)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -322,8 +323,29 @@ if (empty($reshook))
}
$result=$object->update($user,0,$nosyncuser,$nosyncuserpass);
if ($result >= 0 && ! count($object->errors))
{
// Categories association
// First we delete all categories association
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_member';
$sql .= ' WHERE fk_member = ' . $object->id;
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
// Then we add the associated categories
$categories = GETPOST('memcats', 'array');
if (! empty($categories))
{
$cat = new Categorie($db);
foreach ($categories as $id_category)
{
$cat->fetch($id_category);
$cat->add_type($object, 'member');
}
}
// Logo/Photo save
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1,$object,'member').'/photos';
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
@ -536,6 +558,18 @@ if (empty($reshook))
$result=$object->create($user);
if ($result > 0)
{
// Categories association
$memcats = GETPOST('memcats', 'array');
if (! empty($memcats))
{
$cat = new Categorie($db);
foreach ($memcats as $id_category)
{
$cat->fetch($id_category);
$cat->add_type($object, 'member');
}
}
$db->commit();
$rowid=$object->id;
$action='';
@ -899,6 +933,15 @@ else
print $form->selectyesno("public",$object->public,1);
print "</td></tr>\n";
// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td>' . fieldLabel('Categories', 'memcars') . '</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%');
print "</td></tr>";
}
// Other attributes
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@ -1024,7 +1067,7 @@ else
print '<table class="border" width="100%">';
// Ref
print '<tr><td>'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$object->id.'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$object->id.'</td></tr>';
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
@ -1070,7 +1113,7 @@ else
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?$_POST["societe"]:$object->societe).'"></td></tr>';
// Civility
print '<tr><td width="20%">'.$langs->trans("UserTitle").'</td><td width="35%">';
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id)."\n";
print '</td>';
print '</tr>';
@ -1144,12 +1187,27 @@ else
print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1);
print "</td></tr>\n";
// Categories
if (! empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
{
print '<tr><td>' . fieldLabel('Categories', 'memcats') . '</td>';
print '<td colspan="2">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
$c = new Categorie($db);
$cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print $form->multiselectarray('memcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
print "</td></tr>";
}
// Other attributes
$parameters=array();
$parameters=array("colspan"=>2);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields,'edit');
print $object->showOptionals($extrafields,'edit',$parameters);
}
// Third party Dolibarr
@ -1291,7 +1349,7 @@ else
$helpcontent.=dol_htmlentitiesbr($texttosend)."\n";
$label=$form->textwithpicto($tmp,$helpcontent,1,'help');
// Cree un tableau formulaire
// Create form popup
$formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false));
if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_MAILMAN)) {
@ -1465,12 +1523,21 @@ else
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>';
// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td>' . $langs->trans("Categories") . '</td>';
print '<td colspan="2">';
print $form->showCategories($object->id, 'member', 1);
print '</td></tr>';
}
// Other attributes
$parameters=array();
$parameters=array('colspan'=>2);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields);
print $object->showOptionals($extrafields, 'view', $parameters);
}
// Third party Dolibarr

View File

@ -53,6 +53,12 @@ $pagenext = $page + 1;
if (! $sortorder) { $sortorder="DESC"; }
if (! $sortfield) { $sortfield="d.lastname"; }
$label=GETPOST("libelle","alpha");
$cotisation=GETPOST("cotisation","int");
$vote=GETPOST("vote","int");
$comment=GETPOST("comment");
$mail_valid=GETPOST("mail_valid");
// Security check
$result=restrictedArea($user,'adherent',$rowid,'adherent_type');
@ -83,11 +89,11 @@ if ($action == 'add' && $user->rights->adherent->configurer)
{
$object = new AdherentType($db);
$object->libelle = trim($_POST["libelle"]);
$object->cotisation = trim($_POST["cotisation"]);
$object->note = trim($_POST["comment"]);
$object->mail_valid = trim($_POST["mail_valid"]);
$object->vote = trim($_POST["vote"]);
$object->libelle = trim($label);
$object->cotisation = trim($cotisation);
$object->note = trim($comment);
$object->mail_valid = trim($mail_valid);
$object->vote = trim($vote);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -120,12 +126,12 @@ if ($action == 'update' && $user->rights->adherent->configurer)
if ($_POST["button"] != $langs->trans("Cancel"))
{
$object = new AdherentType($db);
$object->id = $_POST["rowid"];
$object->libelle = trim($_POST["libelle"]);
$object->cotisation = trim($_POST["cotisation"]);
$object->note = trim($_POST["comment"]);
$object->mail_valid = trim($_POST["mail_valid"]);
$object->vote = trim($_POST["vote"]);
$object->id = $rowid;
$object->libelle = trim($label);
$object->cotisation = trim($cotisation);
$object->note = trim($comment);
$object->mail_valid = trim($mail_valid);
$object->vote = trim($vote);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -169,6 +175,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
print_fiche_titre($langs->trans("MembersTypes"));
dol_fiche_head('');
$sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
@ -197,7 +204,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td><a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a></td>';
print '<td>'.$objp->libelle.'</td>';
print '<td>'.dol_escape_htmltag($objp->libelle).'</td>';
print '<td align="center">'.yn($objp->cotisation).'</td>';
print '<td align="center">'.yn($objp->vote).'</td>';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
@ -211,6 +218,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
dol_print_error($db);
}
dol_fiche_end();
/*
* Hotbar
@ -246,7 +254,7 @@ if ($action == 'create')
print '<table class="border" width="100%">';
print '<tbody>';
print '<input type="hidden" name="action" value="add">';
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
@ -277,7 +285,7 @@ if ($action == 'create')
}
print '<tbody>';
print "</table>\n";
dol_fiche_end();
print '<div class="center">';
@ -317,7 +325,7 @@ if ($rowid > 0)
print '</td></tr>';
// Label
print '<tr><td width="15%">'.$langs->trans("Label").'</td><td>'.$object->libelle.'</td></tr>';
print '<tr><td width="15%">'.$langs->trans("Label").'</td><td>'.dol_escape_htmltag($object->libelle).'</td></tr>';
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
print yn($object->cotisation);
@ -343,7 +351,9 @@ if ($rowid > 0)
}
print '</table>';
print '</div>';
dol_fiche_end();
/*
* Hotbar
@ -493,15 +503,15 @@ if ($rowid > 0)
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="12"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
print '<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'" size="7"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_email" value="'.$search_email.'" size="12"></td>';
print '<input class="flat" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'" size="12"></td>';
print '<td class="liste_titre">&nbsp;</td>';
@ -563,7 +573,7 @@ if ($rowid > 0)
if ($datefin)
{
print '<td align="center" class="nowrap">';
if ($datefin < time() && $objp->statut > 0)
if ($datefin < dol_now() && $objp->statut > 0)
{
print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
}
@ -634,17 +644,18 @@ if ($rowid > 0)
$head = member_type_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="action" value="update">';
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
print '<table class="border" width="100%">';
print '<tr><td width="15%">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.$object->libelle.'"></td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.dol_escape_htmltag($object->libelle).'"></td></tr>';
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
print $form->selectyesno("cotisation",$object->cotisation,1);
@ -683,6 +694,8 @@ if ($rowid > 0)
print '</table><br><br>';
}
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
@ -693,6 +706,7 @@ if ($rowid > 0)
}
}
$db->close();
llxFooter();
$db->close();

View File

@ -68,7 +68,15 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity);
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
@ -148,7 +156,7 @@ if ($action == 'edit') // Edit
print '</table><br>'."\n";
// Themes
// Themes and themes options
show_theme(null,1);
print '<br>';

View File

@ -230,7 +230,6 @@ $linuxlike=1;
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail';
$port=! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:ini_get('smtp_port');
if (! $port) $port=25;
@ -275,8 +274,21 @@ if ($action == 'edit')
';
if ($linuxlike)
{
print ' jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true);';
print ' jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true);';
print '
jQuery("#MAIN_MAIL_SMTP_SERVER").hide();
jQuery("#MAIN_MAIL_SMTP_PORT").hide();
jQuery("#smtp_server_mess").show();
jQuery("#smtp_port_mess").show();
';
}
else
{
print '
jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true);
jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true);
jQuery("#smtp_server_mess").hide();
jQuery("#smtp_port_mess").hide();
';
}
print '
}
@ -287,7 +299,11 @@ if ($action == 'edit')
jQuery("#MAIN_MAIL_EMAIL_TLS").removeAttr("disabled");
jQuery("#MAIN_MAIL_SMTP_SERVER").removeAttr("disabled");
jQuery("#MAIN_MAIL_SMTP_PORT").removeAttr("disabled");
}
jQuery("#MAIN_MAIL_SMTP_SERVER").show();
jQuery("#MAIN_MAIL_SMTP_PORT").show();
jQuery("#smtp_server_mess").hide();
jQuery("#smtp_port_mess").hide();
}
}
initfields();
jQuery("#MAIN_MAIL_SENDMODE").change(function() {
@ -336,7 +352,7 @@ if ($action == 'edit')
}
print '</td></tr>';
// Server
// Host server
$var=!$var;
print '<tr '.$bc[$var].'><td>';
if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
@ -357,6 +373,7 @@ if ($action == 'edit')
{
print '<input class="flat" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" size="18" value="' . $mainserver . '">';
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_sav" name="MAIN_MAIL_SMTP_SERVER_sav" value="' . $mainserver . '">';
print '<span id="smtp_server_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
}
else
{
@ -389,6 +406,7 @@ if ($action == 'edit')
{
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT" name="MAIN_MAIL_SMTP_PORT" size="3" value="' . $mainport . '">';
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_sav" name="MAIN_MAIL_SMTP_PORT_sav" value="' . $mainport . '">';
print '<span id="smtp_port_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
}
else
{
@ -509,7 +527,7 @@ else
print $text;
print '</td></tr>';
// Server
// Host server
$var=!$var;
if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail'))
{

View File

@ -190,7 +190,7 @@ if ($result)
print_liste_field_titre($langs->trans("IP"),$_SERVER["PHP_SELF"],"e.ip","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"u.login","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"e.description","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre('','','');
print_liste_field_titre('');
print "</tr>\n";

View File

@ -134,7 +134,7 @@ if ($savehandler == 'files')
print_liste_field_titre($langs->trans("DateModification"),$_SERVER["PHP_SELF"],"datem","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Age"),$_SERVER["PHP_SELF"],"age","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Raw"),$_SERVER["PHP_SELF"],"raw","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre('','','');
print_liste_field_titre('');
print "</tr>\n";
$var=True;

View File

@ -103,7 +103,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre('','','');
print_liste_field_titre('');
print "</tr>\n";
$var=True;

View File

@ -131,8 +131,8 @@ if ($resql)
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder);
print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
print_liste_field_titre($langs->trans("Email"));
print_liste_field_titre($langs->trans("Phone"));
print "</tr>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'?type='.$_GET["type"].'" method="GET">';

View File

@ -419,13 +419,8 @@ if ($object->fetch($id) >= 0)
print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,'','align="center"',$sortfield,$sortorder);
}
// Statut
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder);
//Search Icon
print '<td class="liste_titre">';
print '&nbsp';
print '</td>';
print_liste_field_titre('');
print '</tr>';

View File

@ -66,7 +66,7 @@ class PropaleStats extends Stats
$this->field='total_ht';
$this->field_line='total_ht';
$this->where.= " p.fk_statut > 0";
//$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity;
$this->where.= " AND p.entity IN (".getEntity('propal', 1).")";
@ -183,7 +183,7 @@ class PropaleStats extends Stats
return $this->_getAllByYear($sql);
}
/**
* Return nb, amount of predefined product for year
@ -193,9 +193,11 @@ class PropaleStats extends Stats
*/
function getAllByProduct($year)
{
global $user;
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
$sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE ".$this->where;
$sql.= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid";
$sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'";
@ -204,5 +206,5 @@ class PropaleStats extends Stats
//$sql.= $this->db->plimit(20);
return $this->_getAllByProduct($sql);
}
}
}

View File

@ -113,12 +113,12 @@ if ($conf->salaries->enabled)
$total = 0 ;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$var=1;
while ($i < $num)

View File

@ -139,7 +139,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","","&socid=$socid",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("FeesKilometersOrAmout"),$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"], '');
print_liste_field_titre('');
print "</tr>\n";
// Filters lines

View File

@ -592,11 +592,11 @@ else
$i = 0;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Ref").'</td>';
print_liste_field_titre($langs->trans("Ref"));
print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"s.nom","","&socid=$socid","",$sortfiled,$sortorder);
print '</td><td align="right">'.$langs->trans("Amount").'</td>';
print '<td>&nbsp;</td>';
print "</td>\n";
print_liste_field_titre($langs->trans("Amount"),'','','','','align="right"');
print_liste_field_titre('');
print "</tr>\n";
if ($num > 0)
{

View File

@ -323,8 +323,7 @@ if ($resql)
print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Received'),$_SERVER['PHP_SELF'],'am','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_statut,paye,am','',$param,'align="right"',$sortfield,$sortorder);
//print '<td class="liste_titre">&nbsp;</td>';
print '</tr>';
print "</tr>\n";
// Filters lines
print '<tr class="liste_titre">';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
@ -109,15 +109,22 @@ if (! empty($conf->holiday->enabled))
{
$user_id = $user->id;
$nbaquis=$holiday->getCPforUser($user_id);
$nbdeduced=$holiday->getConfCP('nbHolidayDeducted');
$nb_holiday = $nbaquis / $nbdeduced;
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Holidays").'</td></tr>';
print "<tr ".$bc[0].">";
print '<td colspan="3">';
print $langs->trans('SoldeCPUser',round($nb_holiday,2)).($nbdeduced != 1 ? ' ('.$nbaquis.' / '.$nbdeduced.')' : '');
$out='';
$typeleaves=$holiday->getTypes(1,1);
foreach($typeleaves as $key => $val)
{
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
$nb_holiday += $nb_type;
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'<br>';
print $out;
print '</td>';
print '</tr>';
print '</table><br>';

View File

@ -705,7 +705,7 @@ if (! GETPOST('action'))
print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder);
print '<td>&nbsp;</td>';
print_liste_field_titre('');
print "</tr>\n";
while ($i < min($num,$limit))

View File

@ -88,7 +88,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","","",'width="80" align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"c.libelle","","",'align="right"',$sortfield,$sortorder);
print "<td>&nbsp;</td>";
print_liste_field_titre('');
print "</tr>\n";
while ($i < min($num,$limit))

View File

@ -625,7 +625,7 @@ else
print_liste_field_titre($langs->trans("Bank"),$_SERVER["PHP_SELF"],"b.banque", "",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('','','');
print_liste_field_titre('');
print "</tr>\n";
$i=1;
$var=false;

View File

@ -161,7 +161,7 @@ if ($resql)
{
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder);
}
print '<td class="liste_titre">&nbsp;</td>';
print_liste_field_titre('');
print "</tr>\n";
// Lines for filters fields

View File

@ -75,17 +75,16 @@ if ($result)
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num);
print"\n<!-- debut table -->\n";
print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("WithdrawalsReceipts"),$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"');
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"p.datec","","",'class="liste_titre" align="center"');
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"","","",'align="center"');
print '</tr>';
print "</tr>\n";
print '<tr class="liste_titre">';
print '<form action="bons.php" method="GET">';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="'. $search_line.'" size="10"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';

View File

@ -308,7 +308,7 @@ if ($id > 0)
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","",$urladd,'align="center"');
print_liste_field_titre('');
print '</tr>';
print "</tr>\n";
$var=false;

View File

@ -147,7 +147,9 @@ if ($result)
print_liste_field_titre($langs->trans("Bill"),$_SERVER["PHP_SELF"],"p.ref",'',$urladd,'class="liste_titre"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd,'class="liste_titre"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"f.total_ttc","",$urladd,'class="liste_titre" align="center"',$sortfield,$sortorder);
print '<td class="liste_titre" colspan="2">&nbsp;</td></tr>';
print_liste_field_titre('');
print_liste_field_titre('');
print "</tr>\n";
$var=false;

View File

@ -124,8 +124,8 @@ if ($result)
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client",'','','align="center"');
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"p.datec","","",'align="center"');
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","","",'align="right"');
print '<td class="liste_titre">&nbsp;</td>';
print '</tr>';
print_liste_field_titre('');
print "</tr>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
print '<tr class="liste_titre">';

View File

@ -92,7 +92,7 @@ if ($result)
print_liste_field_titre($langs->trans("Line"),$_SERVER["PHP_SELF"],"p.ref",'',$urladd);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd);
print_liste_field_titre($langs->trans("Reason"),$_SERVER["PHP_SELF"],"pr.motif","",$urladd);
print '</tr>';
print "</tr>\n";
$var=True;

View File

@ -127,14 +127,14 @@ if ($result)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.salary","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("");
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.salary","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
print "</tr>\n";
print '<tr class="liste_titre">';

View File

@ -140,7 +140,7 @@ if ($result)
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("");
print_liste_field_titre('');
print "</tr>\n";
print '<tr class="liste_titre">';

View File

@ -921,7 +921,11 @@ class Contact extends CommonObject
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
$label.= '<br><b>' . $langs->trans("Poste") . ':</b> '.$this->poste;
$label.= '<br><b>' . $langs->trans("EMail") . ':</b> '.$this->email;
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',array($this->phone_pro,$this->phone_mobile,$this->phone_perso));
$phonelist=array();
if ($this->phone_pro) $phonelist[]=$this->phone_pro;
if ($this->phone_mobile) $phonelist[]=$this->phone_mobile;
if ($this->phone_pesro) $phonelist[]=$this->phone_perso;
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',$phonelist);
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@ -131,7 +131,7 @@ $formother=new FormOther($db);
$sql = "SELECT s.rowid as socid, s.nom as name,";
$sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email, p.skype,";
$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,";
$sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.tms,";
$sql.= " co.code as country_code";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = p.fk_pays";
@ -311,10 +311,10 @@ if ($result)
print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut", $begin, $param, 'align="center"', $sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>';
print_liste_field_titre('');
print "</tr>\n";
// Ligne des champs de filtres
// Lines for filter fields
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_lastname" size="9" value="'.dol_escape_htmltag($search_lastname).'">';
@ -377,6 +377,10 @@ if ($result)
$contactstatic->firstname='';
$contactstatic->id=$obj->cidp;
$contactstatic->statut=$obj->statut;
$contactstatic->poste=$obj->poste;
$contactstatic->phone_pro=$obj->phone_pro;
$contactstatic->phone_perso=$obj->phone_perso;
$contactstatic->phone_mobile=$obj->phone_mobile;
print $contactstatic->getNomUrl(1,'',20);
print '</td>';
@ -403,7 +407,7 @@ if ($result)
}
// Phone
print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
print '<td>'.dol_print_phone($obj->phone_pro,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
// Phone mobile
print '<td>'.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
// Fax

View File

@ -20,7 +20,6 @@
* \file htdocs/core/boxes/box_task.php
* \ingroup Projet
* \brief Module to Task activity of the current year
* \version $Id: box_task.php,v 1.1 2012/09/11 Charles-François BENKE
*/
include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
@ -123,8 +122,7 @@ class box_task extends ModeleBoxes
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" colspan="2" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));

View File

@ -39,7 +39,7 @@ class CMailFile
var $subject; // Topic: Subject of email
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '<myemail@example.com>' or 'John Doe <myemail@example.com>' or '<myemail+trackingid@example.com>')
// Sender: Who send the email ("Sender" has sent emails on behalf of "From").
// Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, use for Sender an email of the protected domain.
// Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, add Sender field with an email of the protected domain.
// Return-Path: Email where to send bounds.
var $errors_to; // Errors-To: Email where to send errors.
var $addr_to;
@ -408,8 +408,8 @@ class CMailFile
$bounce = ''; // By default
if (! empty($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F))
{
// le return-path dans les header ne fonctionne pas avec tous les MTA
// Le passage par -f est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie.
// le "Return-Path" (retour des messages bounced) dans les header ne fonctionne pas avec tous les MTA
// Le forcage de la valeure grace à l'option -f de sendmail est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie.
// La variable definie pose des pb avec certains sendmail securisee (option -f refusee car dangereuse)
$bounce .= ($bounce?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') );
}
@ -427,7 +427,15 @@ class CMailFile
if (! $res)
{
$this->error="Failed to send mail with php mail to HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port')."<br>Check your server logs and your firewalls setup";
$this->error="Failed to send mail with php mail";
$linuxlike=1;
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
if (! $linuxlike)
{
$this->error.=" to HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'); // This values are value used only for non linuxlike systems
}
$this->error.=".<br>Check your server logs and your firewalls setup";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
}
else

View File

@ -135,7 +135,7 @@ abstract class CommonObject
$sql = "SELECT rowid, ref, ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
$sql.= " WHERE entity IN (".getEntity($element).")" ;
$sql.= " WHERE entity IN (".getEntity($element,1).")" ;
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
@ -3572,8 +3572,8 @@ abstract class CommonObject
* Function to show lines of extrafields with output datas
*
* @param object $extrafields Extrafield Object
* @param string $mode Show output (view) or input (edit) for extrafield
* @param array $params Optionnal parameters
* @param string $mode Show output ('view') or input ('edit') for extrafield
* @param array $params Optionnal parameters. Example: array('colspan'=>2)
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
*
* @return string

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
@ -23,19 +23,23 @@
/**
* \class DolCookie
* \brief Class to manage cookies
* Class to manage cookies.
* This class is used by external module multicompany but will be removed soon only and must not be used by
*
* @deprecated PHP already provide function to read/store a cookie. No need to use a dedicated class. Also storing sensitive information into cookie is forbidden, so encryption is useless.
* If a data is sensitive, it must be stored into database (if we need a long term retention) or into session.
*/
class DolCookie
{
var $myKey;
private $_myKey;
private $_iv;
var $myCookie;
var $myValue;
var $myExpire;
var $myPath;
var $myDomain;
var $mySecure;
var $cookiearray;
var $cookie;
/**
@ -45,8 +49,8 @@ class DolCookie
*/
function __construct($key = '')
{
$this->myKey = $key;
$this->cookiearray = array();
$this->_myKey = hash('sha256', $key, TRUE);
$this->_iv = md5(md5($this->_myKey));
$this->cookie = "";
$this->myCookie = "";
$this->myValue = "";
@ -58,16 +62,12 @@ class DolCookie
*
* @return void
*/
function cryptCookie()
private function _cryptCookie()
{
if (!empty($this->myKey))
if (!empty($this->_myKey) && !empty($this->_iv))
{
$valuecrypt = base64_encode($this->myValue);
$max=dol_strlen($valuecrypt)-1;
for ($f=0 ; $f <= $max; $f++)
{
$this->cookie .= intval(ord($valuecrypt[$f]))*$this->myKey."|";
}
$this->cookie = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->_myKey, $valuecrypt, MCRYPT_MODE_CBC, $this->_iv));
}
else
{
@ -82,19 +82,12 @@ class DolCookie
*
* @return string
*/
function decryptCookie()
private function _decryptCookie()
{
if (!empty($this->myKey))
if (!empty($this->_myKey) && !empty($this->_iv))
{
$this->cookiearray = explode("|",$_COOKIE[$this->myCookie]);
$this->myValue = "" ;
$num = (count($this->cookiearray) - 2);
for ($f = 0; $f <= $num; $f++)
{
if (!empty($this->myKey)) {
$this->myValue .= strval(chr($this->cookiearray[$f]/$this->myKey));
}
}
$this->cookie = $_COOKIE[$this->myCookie];
$this->myValue = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->_myKey, base64_decode($this->cookie), MCRYPT_MODE_CBC, $this->_iv));
return(base64_decode($this->myValue));
}
@ -115,7 +108,7 @@ class DolCookie
* @param int $secure 0 or 1
* @return void
*/
function _setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
public function setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
{
$this->myCookie = $cookie;
$this->myValue = $value;
@ -126,7 +119,7 @@ class DolCookie
//print 'key='.$this->myKey.' name='.$this->myCookie.' value='.$this->myValue.' expire='.$this->myExpire;
$this->cryptCookie();
$this->_cryptCookie();
}
/**
@ -135,11 +128,11 @@ class DolCookie
* @param string $cookie Cookie name
* @return string Decrypted value
*/
function _getCookie($cookie)
public function getCookie($cookie)
{
$this->myCookie = $cookie;
$decryptValue = $this->decryptCookie();
$decryptValue = $this->_decryptCookie();
return $decryptValue;
}

View File

@ -398,7 +398,7 @@ class Form
if ($direction > 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-right: 3px !important;'; }
$htmltext=str_replace('"',"&quot;",$htmltext);
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on img tag to store tooltip
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
@ -5146,11 +5146,11 @@ class Form
*/
global $dolibarr_main_url_root;
$ret.='<!-- Put link to gravatar -->';
$ret.='<img class="photo'.$modulepart.'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,2)).'">'; // gravatar need md5 hash
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,2)).'">'; // gravatar need md5 hash
}
else
{
$ret.='<img class="photo'.$modulepart.'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
}
}

View File

@ -795,8 +795,8 @@ class FormFile
print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$url,"date","",$param,'align="center"',$sortfield,$sortorder);
if (empty($useinecm)) print_liste_field_titre('',$url,"","",$param,'align="center"');
print_liste_field_titre('','','');
print '</tr>';
print_liste_field_titre('');
print "</tr>\n";
$nboffiles=count($filearray);
@ -866,14 +866,26 @@ class FormFile
if (image_format_supported($file['name']) > 0)
{
$permtoedit=0;
if ($user->rights->produit->creer && $object->type == Product::TYPE_PRODUCT) $permtoedit=1;
if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoedit=1;
$newmodulepart=$modulepart;
if ($modulepart == 'product' || $modulepart == 'produit' || $modulepart == 'service')
{
if ($user->rights->produit->creer && $object->type == Product::TYPE_PRODUCT) $permtoedit=1;
if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoedit=1;
$newmodulepart='produit|service';
}
/* TODO Not yet working
if ($modulepart == 'holiday')
{
if ($user->rights->holiday->write_all) $permtoedit=1;
}
*/
if (empty($conf->global->MAIN_UPLOAD_DOC)) $permtoedit=0;
if ($permtoedit)
{
// Link to resize
print '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode('produit|service').'&id='.$object->id.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'</a> &nbsp; ';
print '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode($newmodulepart).'&id='.$object->id.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'</a> &nbsp; ';
}
}
}

View File

@ -582,6 +582,24 @@ class FormOther
}
}
/**
* Output a HTML thumb of color or a text if not defined.
*
* @param string $color String with hex (FFFFFF) or comma RGB ('255,255,255')
* @param string $textifnotdefined Text to show if color not defined
* @return string HTML code for color thumb
* @see selectColor
*/
static function showColor($color, $textifnotdefined='')
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$color = colorArrayToHex(colorStringToArray($color,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 36px; background-color: #'.$color.'" value="'.$color.'">';
else print $textifnotdefined;
}
/**
* Output a HTML code to select a color
*
@ -591,7 +609,7 @@ class FormOther
* @param int $showcolorbox 1=Show color code and color box, 0=Show only color code
* @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
* @return void
* @deprecated
* @deprecated Use instead selectColor
* @see selectColor()
*/
function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='')
@ -609,8 +627,9 @@ class FormOther
* @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
* @param string $morecss Add css style into input field
* @return string
* @see showColor
*/
function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='')
static function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='')
{
// Deprecation warning
if ($form_name) {

View File

@ -400,7 +400,7 @@ class RssParser
{
if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
{
$itemLink = (string) $item['link']['href'];
$itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : '');
$itemTitle = (string) $item['title'];
$itemDescription = (string) $item['summary'];
$itemPubDate = (string) $item['created'];
@ -409,7 +409,7 @@ class RssParser
}
else
{
$itemLink = (string) $item['link']['href'];
$itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : '');
$itemTitle = (string) $item['title'];
$itemDescription = (string) $item['summary'];
$itemPubDate = (string) $item['created'];

View File

@ -20,6 +20,8 @@
//
/**
* addLineBatch
*
* @param index int number of produt. 0 = first product line
*/
function addLineBatch(index)

View File

@ -629,7 +629,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
}
// Edit
print_liste_field_titre('');
print "</tr>";
print "</tr>\n";
print '<tr class="liste_titre">';

View File

@ -226,7 +226,7 @@ function dol_shutdown()
* Return value of a param into GET or POST supervariable
*
* @param string $paramname Name of parameter to found
* @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string), 'custom'= custom filter specify $filter and $options)
* @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string), 'custom'= custom filter specify $filter and $options)
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
* @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails)
* @param mixed $options Options to pass to filter_var when $check is set to custom
@ -545,7 +545,7 @@ function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
/**
* Returns text escaped for inclusion in HTML alt or title tags, or into values of HTMPL input fields
* Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
*
* @param string $stringtoescape String to escape
* @param int $keepb Do not clean b tags
@ -3761,7 +3761,7 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
// TODO if object is null, load it from id and modulepart.
if (! empty($level) && in_array($modulepart, array('cheque','user','category','shipment', 'member','don','donation','supplier_invoice','invoice_supplier')))
if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier')))
{
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num);
@ -4313,17 +4313,16 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1)
/**
* Set event message in dol_events session object. Will be output by calling dol_htmloutput_events.
* Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function.
* Note: Prefer to use setEventMessages instead.
*
* @param mixed $mesgs Message string or array
* @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors')
* @return void
* @see dol_htmloutput_events
* @deprecated Use setEventMessages instead
*/
function setEventMessage($mesgs, $style='mesgs')
{
dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
//dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); This is not deprecated, it is used by setEventMessages function
if (! is_array($mesgs)) // If mesgs is a string
{
if ($mesgs) $_SESSION['dol_events'][$style][] = $mesgs;

View File

@ -651,7 +651,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$masktri='00000';
$maskcounter='00000';
}
$maskraz=-1;
$maskoffset=0;
$resetEveryMonth=false;
@ -670,7 +670,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
if (dol_strlen($maskrefclient_maskcounter) > 0 && dol_strlen($maskrefclient_maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
}
else $maskrefclient='';
// fail if there is neither a global nor a third party counter
if (! $hasglobalcounter && ($maskrefclient_maskcounter == ''))
{
@ -1915,29 +1915,30 @@ function fetchObjectByElement($element_id,$element_type) {
/**
* Convert an array with RGB value into hex RGB value
* Convert an array with RGB value into hex RGB value.
* This is the opposite function of colorStringToArray
*
* @param array $arraycolor Array
* @param string $colorifnotfound Color code to return if entry not defined or not a RGB format
* @return string RGB hex value (without # before). For example: FF00FF
* @see Make the opposite of colorStringToArray
* @return string RGB hex value (without # before). For example: 'FF00FF', '01FF02'
* @see colorStringToArray
*/
function colorArrayToHex($arraycolor,$colorifnotfound='888888')
{
if (! is_array($arraycolor)) return $colorifnotfound;
if (empty($arraycolor)) return $colorifnotfound;
return dechex($arraycolor[0]).dechex($arraycolor[1]).dechex($arraycolor[2]);
return sprintf("%02s",dechex($arraycolor[0])).sprintf("%02s",dechex($arraycolor[1])).sprintf("%02s",dechex($arraycolor[2]));
}
/**
* Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,255).
* This is the opposite function of colorArrayToHex.
* If entry is already an array, return it.
*
* @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255')
* @param array $colorifnotfound Color code array to return if entry not defined
* @return string RGB hex value (without # before). For example: FF00FF
* @see Make the opposite of colorArrayToHex
* @see colorArrayToHex
*/
function colorStringToArray($stringcolor,$colorifnotfound=array(88,88,88))
{

View File

@ -34,11 +34,16 @@ function holiday_prepare_head($object)
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/holiday/card.php?id='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/holiday/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Document');
$head[$h][2] = 'documents';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
@ -68,17 +68,6 @@ function member_prepare_head(Adherent $object)
$h++;
}
// Show category tab
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_MEMBER;
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
$head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category';
$h++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -212,7 +212,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
// Execute hook getLoginPageOptions
// Should be an array with differents options in $hookmanager->resArray
$parameters=array('entity' => GETPOST('entity','int'));
$hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook.
// Login
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
@ -238,7 +238,6 @@ function dol_loginfunction($langs,$conf,$mysoc)
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))
{
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
}
// Security graphical code

View File

@ -254,7 +254,10 @@ function entity_prepare_head($object, $aEntities)
*/
function show_theme($fuser,$edit=0,$foruserprofile=false)
{
global $conf,$langs,$bc;
global $conf,$langs,$db;
global $bc;
$formother = new FormOther($db);
//$dirthemes=array(empty($conf->global->MAIN_FORCETHEMEDIR)?'/theme':$conf->global->MAIN_FORCETHEMEDIR.'/theme');
$dirthemes=array('/theme');
@ -380,9 +383,48 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>';
$hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0');
print '<td colspan="'.($colspan-1).'"><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
print '</tr>';
//if ($conf->theme == 'eldy')
//{
// TopMenuBackgroundColor
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
print '<td colspan="'.($colspan-1).'">';
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' ';
}
else
{
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 36px; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default");
}
print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
// BackgroundTableTitleColor
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("BackgroundTableTitleColor").'</td>';
print '<td colspan="'.($colspan-1).'">';
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1,array()),''),'THEME_ELDY_BACKTITLE1','formcolor',1).' ';
}
else
{
print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default"));
}
print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
//}
print '</tr>';
}
print '</table>';

View File

@ -1217,19 +1217,21 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
*/
if ($mainmenu == 'hrm')
{
// Holiday module
// Leave/Holiday/Vacation module
if (! empty($conf->holiday->enabled))
{
$langs->load("holiday");
$newmenu->add("/holiday/index.php?&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->write, '', $mainmenu, 'hrm');
$newmenu->add("/holiday/card.php?&action=request", $langs->trans("MenuAddCP"), 1,$user->rights->holiday->write);
$newmenu->add("/holiday/list.php?&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm');
$newmenu->add("/holiday/card.php?&action=request", $langs->trans("New"), 1,$user->rights->holiday->write);
$newmenu->add("/holiday/list.php?&leftmenu=hrm", $langs->trans("List"), 1,$user->rights->holiday->read);
$newmenu->add("/holiday/list.php?select_statut=2&leftmenu=hrm", $langs->trans("ListToApprove"), 2, $user->rights->holiday->read);
$newmenu->add("/holiday/define_holiday.php?&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->define_holiday);
$newmenu->add("/holiday/view_log.php?&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->view_log);
$newmenu->add("/holiday/month_report.php?&action=request", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->month_report);
$newmenu->add("/holiday/view_log.php?&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday);
$newmenu->add("/holiday/month_report.php?&action=request", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->define_holiday);
}
// Trips and expenses
// Trips and expenses (old module)
if (! empty($conf->deplacement->enabled))
{
$langs->load("trips");

View File

@ -134,16 +134,16 @@ class modHoliday extends DolibarrModules
$r=0;
$this->rights[$r][0] = 20001; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/modify your own holidays'; // Permission label
$this->rights[$r][1] = 'Read your own holidays'; // Permission label
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;
$this->rights[$r][0] = 20002; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/modify hollidays for everybody'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][1] = 'Create/modify your own holidays'; // Permission label
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;
@ -155,23 +155,23 @@ class modHoliday extends DolibarrModules
$r++;
$this->rights[$r][0] = 20004; // Permission id (must not be already used)
$this->rights[$r][1] = 'Setup holidays of users'; // Permission label
$this->rights[$r][1] = 'Read hollidays for everybody'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'define_holiday'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][4] = 'read_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;
$this->rights[$r][0] = 20005; // Permission id (must not be already used)
$this->rights[$r][1] = 'See logs for holidays requests'; // Permission label
$this->rights[$r][1] = 'Create/modify hollidays for everybody'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'view_log'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;
$this->rights[$r][0] = 20006; // Permission id (must not be already used)
$this->rights[$r][1] = 'Read holidays monthly report'; // Permission label
$this->rights[$r][1] = 'Setup holidays of users (setup and update balance)'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'month_report'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][4] = 'define_holiday'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;

View File

@ -211,7 +211,6 @@ class modUser extends DolibarrModules
$this->export_permission[$r]=array(array("user","user","export"));
$this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.office_phone'=>'Phone','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Administrator",'u.statut'=>'Status','u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion','u.fk_socpeople'=>"IdContact",'u.fk_soc'=>"IdCompany",'u.fk_member'=>"MemberId");
$this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_soc'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:nom");
$this->export_entities_array[$r]=array('u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user','u.fk_socpeople'=>"contact",'u.fk_soc'=>"company",'u.fk_member'=>"member");
if (empty($conf->adherent->enabled))
{

View File

@ -37,7 +37,6 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("products");
$langs->load("other");
@ -52,12 +51,19 @@ $cancel=GETPOST("cancel");
// Security check
if (empty($modulepart)) accessforbidden('Bad value for modulepart');
$accessallowed=0;
if ($modulepart=='produit|service')
if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'service' || $modulepart == 'produit|service')
{
$result=restrictedArea($user,'produit|service',$id,'product&product');
if ($modulepart=='produit|service' && (! $user->rights->produit->lire && ! $user->rights->service->lire)) accessforbidden();
$accessallowed=1;
}
elseif ($modulepart == 'holiday')
{
$result=restrictedArea($user,'holiday',$id,'holiday');
if ($modulepart=='holiday' && (! $user->rights->holiday->read)) accessforbidden();
$accessallowed=1;
}
// Security:
// Limit access if permissions are wrong
@ -66,15 +72,32 @@ if (! $accessallowed)
accessforbidden();
}
$object = new Product($db);
if ($id > 0)
// Define dir according to modulepart
if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'service' || $modulepart == 'produit|service')
{
$result = $object->fetch($id);
if ($result <= 0) dol_print_error($db,'Failed to load object');
$dir=$conf->product->multidir_output[$object->entity]; // By default
if ($object->type == Product::TYPE_PRODUCT) $dir=$conf->product->multidir_output[$object->entity];
if ($object->type == Product::TYPE_SERVICE) $dir=$conf->service->multidir_output[$object->entity];
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$object = new Product($db);
if ($id > 0)
{
$result = $object->fetch($id);
if ($result <= 0) dol_print_error($db,'Failed to load object');
$dir=$conf->product->multidir_output[$object->entity]; // By default
if ($object->type == Product::TYPE_PRODUCT) $dir=$conf->product->multidir_output[$object->entity];
if ($object->type == Product::TYPE_SERVICE) $dir=$conf->service->multidir_output[$object->entity];
}
}
elseif ($modulepart == 'holiday')
{
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$object = new Holiday($db);
if ($id > 0)
{
$result = $object->fetch($id);
if ($result <= 0) dol_print_error($db,'Failed to load object');
$dir=$conf->holiday->dir_output; // By default
}
}
/*
* Actions

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@ -245,6 +245,18 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
<?php
if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $format => $option)
{
if ($format == 'js') {
echo "\n".'<!-- Javascript by hook -->';
echo $option."\n";
}
}
}
?>
<?php
// Google Analytics (need Google module)
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))

View File

@ -527,7 +527,8 @@ jQuery(document).ready(function() {
}
if (this.id == 'pmpprice')
{
var defaultbuyprice = <?php echo (isset($conf->global->MARGIN_PMP_AS_DEFAULT_BUY_PRICE)?int($conf->global->MARGIN_PMP_AS_DEFAULT_BUY_PRICE):1); ?>;
// If margin is calculated on PMP, we set it by defaut (but only if value is not 0)
var defaultbuyprice = <?php echo ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'pmp')?1:0); ?>;
if (this.price > 0 && 1 == defaultbuyprice) { defaultkey = this.id; defaultprice = this.price; }
options += '<option value="'+this.id+'" price="'+this.price+'">'+this.label+'</option>';
}

View File

@ -178,7 +178,7 @@ print_liste_field_titre($langs->trans("CronLastResult"),$_SERVER["PHP_SELF"],"t.
print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVER["PHP_SELF"],"t.lastoutput","",$arg_url,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Enabled"),$_SERVER["PHP_SELF"],"t.status","",$arg_url,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print '</tr>';
print "</tr>\n";
print '<tr class="liste_titre">';
print '<td>&nbsp;</td>';

View File

@ -364,15 +364,15 @@ class ExpenseReport extends CommonObject
/**
* Classify the expense report as paid
*
* @param int $id id of expense report
* @param user $fuser User
* @param int $id Id of expense report
* @param user $fuser User making change
* @return int <0 if KO, >0 if OK
*/
function set_paid($id, $fuser)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."expensereport";
$sql.= " SET fk_statut = 6";
$sql.= " WHERE rowid = $id AND fk_statut = 5";
$sql.= " WHERE rowid = ".$id." AND fk_statut = 5";
dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);

View File

@ -46,7 +46,6 @@ class Export
// To store export modules
var $hexa;
var $hexafilter;
var $hexafiltervalue;
var $datatoexport;
var $model_name;
@ -635,9 +634,6 @@ class Export
$this->db->begin();
$filter='';
if (! empty($this->hexafilter) && ! empty($this->hexafiltervalue)) {
$filter = json_encode(array('field' => $this->hexafilter, 'value' => $this->hexafiltervalue));
}
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'export_model (';
$sql.= 'label,';
@ -646,12 +642,12 @@ class Export
$sql.= 'filter';
$sql.= ') VALUES (';
$sql.= "'".$this->db->escape($this->model_name)."',";
$sql.= "'".$this->datatoexport."',";
$sql.= "'".$this->hexa."',";
$sql.= (! empty($filter)?"'".$filter."'":"null");
$sql.= "'".$this->db->escape($this->datatoexport)."',";
$sql.= "'".$this->db->escape($this->hexa)."',";
$sql.= "'".$this->db->escape($this->hexafiltervalue)."'";
$sql.= ")";
dol_syslog("Export::create", LOG_DEBUG);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@ -675,7 +671,7 @@ class Export
*/
function fetch($id)
{
$sql = 'SELECT em.rowid, em.field, em.label, em.type, em.filter';
$sql = 'SELECT em.rowid, em.label, em.type, em.field, em.filter';
$sql.= ' FROM '.MAIN_DB_PREFIX.'export_model as em';
$sql.= ' WHERE em.rowid = '.$id;
@ -687,13 +683,11 @@ class Export
if ($obj)
{
$this->id = $obj->rowid;
$this->hexa = $obj->field;
$this->model_name = $obj->label;
$this->datatoexport = $obj->type;
$filter = json_decode($obj->filter, true);
$this->hexafilter = (isset($filter['field'])?$filter['field']:'');
$this->hexafiltervalue = (isset($filter['value'])?$filter['value']:'');
$this->hexa = $obj->field;
$this->hexafiltervalue = $obj->filter;
return 1;
}

View File

@ -105,7 +105,7 @@ $entitytolang = array(
);
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
$array_filtervalue=isset($_SESSION["export_FilterValue_fields"])?$_SESSION["export_FilterValue_fields"]:array();
$array_filtervalue=isset($_SESSION["export_filtered_fields"])?$_SESSION["export_filtered_fields"]:array();
$datatoexport=GETPOST("datatoexport");
$action=GETPOST('action', 'alpha');
$confirm=GETPOST('confirm', 'alpha');
@ -228,7 +228,6 @@ if ($action=='downfield' || $action=='upfield')
if ($step == 1 || $action == 'cleanselect')
{
$_SESSION["export_selected_fields"]=array();
//$_SESSION["export_FilterValue_fields"]=array();
$_SESSION["export_filtered_fields"]=array();
$array_selected=array();
$array_filtervalue=array();
@ -286,12 +285,15 @@ if ($action == 'add_export_model')
}
$hexafiltervalue='';
foreach($array_filtervalue as $key=>$val)
if (! empty($array_filtervalue) && is_array($array_filtervalue))
{
if ($hexafilter) $hexafiltervalue.=',';
$hexafiltervalue.=$key.'='.$val;
foreach($array_filtervalue as $key=>$val)
{
if ($hexafiltervalue) $hexafiltervalue.=',';
$hexafiltervalue.=$key.'='.$val;
}
}
$objexport->model_name = $export_name;
$objexport->datatoexport = $datatoexport;
$objexport->hexa = $hexa;
@ -317,10 +319,11 @@ if ($action == 'add_export_model')
}
}
// Reload an predefined export model
if ($step == 2 && $action == 'select_model')
{
$_SESSION["export_selected_fields"]=array();
$_SESSION["export_FilterValue_fields"]=array();
$_SESSION["export_filtered_fields"]=array();
$array_selected=array();
$array_filtervalue=array();
@ -337,16 +340,15 @@ if ($step == 2 && $action == 'select_model')
}
$_SESSION["export_selected_fields"]=$array_selected;
$fieldsarray=explode(',',$objexport->hexafilter);
$fieldsarrayvalue=explode(',',$objexport->hexafiltervalue);
$i=1;
foreach($fieldsarray as $val)
foreach($fieldsarrayvalue as $val)
{
$tmp=explode('=',$val);
$array_filtervalue[$tmp[0]]=$tmp[1];
$i++;
}
$_SESSION["export_FilterValue_fields"]=$array_filtervalue;
$_SESSION["export_filtered_fields"]=$array_filtervalue;
}
}
@ -356,7 +358,7 @@ if ($step == 4 && $action == 'submitFormField')
// on boucle sur les champs selectionne pour recuperer la valeur
if (is_array($objexport->array_export_TypeFields[0]))
{
$_SESSION["export_FilterValue_fields"]=array();
$_SESSION["export_filtered_fields"]=array();
//var_dump($_POST);
foreach($objexport->array_export_TypeFields[0] as $code => $type) // $code: s.fieldname $value: Text|Boolean|List:ccc
{
@ -372,7 +374,7 @@ if ($step == 4 && $action == 'submitFormField')
}
}
$array_filtervalue=(! empty($objexport->array_export_FilterValue[0])?$objexport->array_export_FilterValue[0]:'');
$_SESSION["export_FilterValue_fields"]=$array_filtervalue;
$_SESSION["export_filtered_fields"]=$array_filtervalue;
}
}

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
@ -332,24 +332,33 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
}
else
{
// Extrafields
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$array_options = $extrafields->getOptionalsFromPost($extralabels);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) {
$error ++;
$action = 'create';
}
$object->array_options = $array_options;
if (! $error)
{
// Extrafields
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$array_options = $extrafields->getOptionalsFromPost($extralabels);
$result = $object->create($user);
if ($result > 0)
{
$id=$result; // Force raffraichissement sur fiche venant d'etre cree
}
else
{
$langs->load("errors");
setEventMessages($object->error, $object->errors, 'errors');
$action = 'create';
}
$object->array_options = $array_options;
$result = $object->create($user);
if ($result > 0)
{
$id=$result; // Force raffraichissement sur fiche venant d'etre cree
}
else
{
$langs->load("errors");
setEventMessages($object->error, $object->errors, 'errors');
$action = 'create';
}
}
}
}
else

View File

@ -145,7 +145,7 @@ if ($result)
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder);
}
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"], '');
print_liste_field_titre('');
print "</tr>\n";
print '<tr class="liste_titre">';

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>

View File

@ -462,7 +462,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
print_liste_field_titre($langs->trans('DeliveryDate'), 'orderstoinvoice.php', 'c.date_livraison', '', '&amp;socid=' . $socid, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans('Status'), '', '', '', '', 'align="right"');
print_liste_field_titre($langs->trans('GenerateBill'), '', '', '', '', 'align="center"');
print '</tr>';
print "</tr>\n";
// Lignes des champs de filtre
print '<form method="get" action="orderstoinvoice.php">';

View File

@ -101,9 +101,10 @@ if ($result)
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, "", "", $sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, "", "", $sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, "", "", $sortfield,$sortorder);
print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
print_liste_field_titre($langs->trans("Email"));
print_liste_field_titre($langs->trans("Phone"));
print "</tr>\n";
$var=True;
$i = 0;
while ($i < min($num,$limit))

View File

@ -264,7 +264,7 @@ if ($resql)
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"fac.total_ht","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"fac.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>';
print_liste_field_titre('');
print "</tr>\n";
// Line for filters

View File

@ -545,7 +545,7 @@ if (empty($action))
print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'p.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>';
print_liste_field_titre('');
print "</tr>\n";
// Lines for filters fields

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2012-2103 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2012-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
*
@ -56,267 +56,6 @@ print_fiche_titre($langs->trans('ConfCP'), $linkback, 'title_hrm.png');
$cp = new Holiday($db);
// Contrôle du formulaire
if ($action == "add")
{
$error = 0;
// Option du groupe de validation
/*if (!$cp->updateConfCP('userGroup',$_POST['userGroup']))
{
$error++;
}*/
// Option du délai pour faire une demande de congés payés
if (!$cp->updateConfCP('delayForRequest',$_POST['delayForRequest']))
{
$error++;
}
// Option du nombre de jours à ajouter chaque mois
$nbHolidayEveryMonth = price2num($_POST['nbHolidayEveryMonth'],5);
if(!$cp->updateConfCP('nbHolidayEveryMonth',$nbHolidayEveryMonth))
{
$error++;
}
// Option du nombre de jours pour un mariage
$OptMariageCP = price2num($_POST['OptMariage'],5);
if(!$cp->updateConfCP('OptMariage',$OptMariageCP)) {
$error++;
}
// Option du nombre de jours pour un décés d'un proche
$OptDecesProcheCP = price2num($_POST['OptDecesProche'],5);
if(!$cp->updateConfCP('OptDecesProche',$OptDecesProcheCP)) {
$error++;
}
// Option du nombre de jours pour un mariage d'un enfant
$OptMariageProcheCP = price2num($_POST['OptMariageProche'],5);
if(!$cp->updateConfCP('OptMariageProche',$OptMariageProcheCP)) {
$error++;
}
// Option du nombre de jours pour un décés d'un parent
$OptDecesParentsCP = price2num($_POST['OptDecesParents'],5);
if(!$cp->updateConfCP('OptDecesParents',$OptDecesParentsCP)) {
$error++;
}
// Option pour avertir le valideur si délai de demande incorrect
if(isset($_POST['AlertValidatorDelay'])) {
if(!$cp->updateConfCP('AlertValidatorDelay','1')) {
$error++;
}
} else {
if(!$cp->updateConfCP('AlertValidatorDelay','0')) {
$error++;
}
}
// Option pour avertir le valideur si solde des congés de l'utilisateur inccorect
if(isset($_POST['AlertValidatorSolde'])) {
if(!$cp->updateConfCP('AlertValidatorSolde','1')) {
$error++;
}
} else {
if(!$cp->updateConfCP('AlertValidatorSolde','0')) {
$error++;
}
}
// Option du nombre de jours à déduire pour 1 jour de congés
$nbHolidayDeducted = price2num($_POST['nbHolidayDeducted'],5);
if(!$cp->updateConfCP('nbHolidayDeducted',$nbHolidayDeducted))
{
$error++;
}
if ($error)
{
setEventMessage($langs->trans('ErrorUpdateConfCP'), 'errors');
} else {
setEventMessage($langs->trans('UpdateConfCPOK'));
}
// Si première mise à jour, prévenir l'utilisateur de mettre à jour le solde des congés payés
$sql = "SELECT *";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users";
$result = $db->query($sql);
$num = $db->num_rows($sql);
if($num < 1)
{
$cp->createCPusers();
setEventMessage($langs->trans('AddCPforUsers'), 'warnings');
}
// Si il s'agit de créer un event
}
elseif ($action == 'create_event')
{
$error = 0;
$optName = trim($optName);
$optValue = price2num($optValue,5);
if (! $optName)
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors');
$error++;
}
if (! $optValue > 0)
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")), 'errors');
$error++;
}
$cp->optName = $optName;
$cp->optValue = $optValue;
if (! $error)
{
$result = $cp->createEventCP($user);
if($result > 0)
{
setEventMessage('OkCreateEventCP');
$optName='';
$optValue='';
}
else
{
setEventMessage($cp->error, 'errors');
}
}
}
elseif($action == 'event' && isset($_POST['update_event']))
{
$error = 0;
$eventId = array_keys($_POST['update_event']);
$eventId = $eventId[0];
$eventName = $optName;
$eventName = $eventName[$eventId];
$eventValue = $optValue;
$eventValue = $eventValue[$eventId];
if (!empty($eventName))
{
$eventName = trim($eventName);
} else {
$error++;
}
if (!empty($eventValue))
{
$eventValue = price2num($eventValue,5);
} else {
$error++;
}
if (!$error)
{
// Mise à jour des congés de l'utilisateur
$update = $cp->updateEventCP($eventId,$eventName,$eventValue);
if(!$update) {
setEventMessage('ErrorUpdateEventCP', 'errors');
} else {
setEventMessage('UpdateEventOkCP');
}
} else {
setEventMessage('ErrorUpdateEventCP', 'errors');
}
}
elseif($action && isset($_POST['delete_event']))
{
$eventId = array_keys($_POST['delete_event']);
$eventId = $eventId[0];
$result = $cp->deleteEventCP($eventId);
if($result) {
print '<div class="tabBar">';
print $langs->trans('DeleteEventOkCP');
print '</div>';
} else {
print '<div class="tabBar">';
print $langs->trans('ErrorDeleteEventCP');
print '</div>';
}
}
/*print '<br>';
print_fiche_titre($langs->trans('TitleOptionMainCP'),'','');
dol_fiche_head(array(),'','');
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?leftmenu=setup" name="config">'."\n";
print '<input type="hidden" name="action" value="add" />'."\n";
print '<table class="noborder" width="100%">';
print '<tbody>';
print '<tr class="liste_titre">';
print '<th class="liste_titre">'.$langs->trans('DescOptionCP').'</td>';
print '<th class="liste_titre">'.$langs->trans('ValueOptionCP').'</td>';
print '</tr>';
$var=true;
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td style="padding:5px;">'.$langs->trans('DelayForSubmitCP').'</td>'."\n";
print '<td style="padding:5px;"><input class="flat" type="text" name="delayForRequest" value="'.$cp->getConfCP('delayForRequest').'" size="2" /> '.$langs->trans('DurationDays').'</td>'."\n";
print '</tr>'."\n";
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td style="padding:5px;">'.$langs->trans('AlertValidatorDelayCP').'</td>'."\n";
print '<td style="padding:5px;"><input class="flat" type="checkbox" name="AlertValidatorDelay" '.$cp->getCheckOption('AlertValidatorDelay').'/></td>'."\n";
print '</tr>'."\n";
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td style="padding:5px;">'.$langs->trans('AlertValidorSoldeCP').'</td>'."\n";
print '<td style="padding:5px;"><input class="flat" type="checkbox" name="AlertValidatorSolde" '.$cp->getCheckOption('AlertValidatorSolde').'/></td>'."\n";
print '</tr>'."\n";
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td style="padding:5px;">'.$langs->trans('nbHolidayEveryMonthCP').'</td>'."\n";
print '<td style="padding:5px;"><input class="flat" type="text" name="nbHolidayEveryMonth" value="'.$cp->getConfCP('nbHolidayEveryMonth').'" size="5"/> '.$langs->trans('DurationDays').'</td>'."\n";
print '</tr>'."\n";
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td style="padding:5px;">'.$langs->trans('nbHolidayDeductedCP').'</td>'."\n";
print '<td style="padding:5px;"><input class="flat" type="text" name="nbHolidayDeducted" value="'.$cp->getConfCP('nbHolidayDeducted').'" size="2"/> '.$langs->trans('DurationDays').'</td>'."\n";
print '</tr>'."\n";
print '</tbody>'."\n";
print '</table>'."\n";
print '<div align="center"><input type="submit" value="'.$langs->trans("ConfirmConfigCP").'" name="bouton" class="button"/></div>'."\n";
print '</form>'."\n\n";
dol_fiche_end();
*/
/*$var=!$var;
print $langs->trans('nbUserCP').': '."\n";
print $cp->getConfCP('nbUser')."<br>\n";
*/
print '<br>'.$langs->trans("GoIntoDictionaryHolidayTypes").'<br><br>';
$var=!$var;
@ -325,85 +64,6 @@ if ($cp->getConfCP('lastUpdate')) print '<strong>'.dol_print_date($db->jdate($cp
else print $langs->trans('None');
print "</div><br>\n";
/*
print '<br>';
print_fiche_titre($langs->trans('TitleOptionEventCP'),'','');
dol_fiche_head(array(),'','');
$cp_events = $cp->fetchEventsCP();
if($cp_events == 1) {
$var = false;
$i = 0;
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?leftmenu=setup" name="event_update">'."\n";
print '<input type="hidden" name="action" value="event" />'."\n";
print '<table class="noborder" width="100%">'."\n";
print '<tbody>'."\n";
print '<tr class="liste_titre">'."\n";
print '<td class="liste_titre" width="40%">'.$langs->trans('NameEventCP').'</td>'."\n";
print '<td class="liste_titre" width="20%">'.$langs->trans('ValueOptionCP').'</td>'."\n";
print '<td class="liste_titre">&nbsp;</td>'."\n";
print '<td class="liste_titre">&nbsp;</td>'."\n";
print '</tr>'."\n";
foreach($cp->events as $infos_event)
{
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td><input class="flat" type="text" size="40" name="optName['.$infos_event['rowid'].']" value="'.$infos_event['name'].'" /></td>'."\n";
print '<td><input class="flat" type="text" size="2" name="optValue['.$infos_event['rowid'].']" value="'.$infos_event['value'].'" /> '.$langs->trans('DurationDays').'</td>'."\n";
print '<td><input type="submit" class="button" name="update_event['.$infos_event['rowid'].']" value="'.dol_escape_htmltag($langs->trans("Save")).'"/></td>'."\n";
print '<td width="20px" align="right"><input type="image" alt="'.$langs->trans("Delete").'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" name="delete_event['.$infos_event['rowid'].']" style="border:0;"/></td>'."\n";
print '</tr>';
$i++;
}
print '</tbody>'."\n";
print '</table>'."\n";
print '</form>'."\n";
print '<br />'."\n\n";
}
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?leftmenu=setup" name="event_create">'."\n";
print '<input type="hidden" name="action" value="create_event" />'."\n";
print $langs->trans('TitleCreateEventCP');
print '<table class="noborder" width="100%">';
print '<tbody>';
print '<tr class="liste_titre">';
print '<td class="liste_titre" width="40%">'.$langs->trans('NameEventCP').'</td>';
print '<td class="liste_titre" width="20%">'.$langs->trans('ValueOptionCP').'</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '</tr>';
print '<tr class="pair">';
print '<td><input class="flat" type="text" size="40" name="optName" value="'.(is_array($optName)?'':$optName).'" /></td>'."\n";
print '<td><input class="flat" type="text" size="2" name="optValue" value="'.(is_array($optValue)?'':$optValue).'" /> '.$langs->trans('DurationDays').'</td>'."\n";
print '<td><input type="submit" class="button" name="button" value="'.$langs->trans('CreateEventCP').'" /></td>'."\n";
print '</tr>'."\n";
print '</tbody>';
print '</table>';
print '</form>';
dol_fiche_end();
*/
// Fin de page
llxFooter();

View File

@ -277,7 +277,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights-
if (! $error)
{
$db->commit();
header('Location: index.php');
header('Location: list.php');
exit;
}
else
@ -839,7 +839,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
// Approved by
print '<tr>';
print '<td class="fieldrequired">'.$langs->trans("ReviewedByCP").'</td>';
// Liste des utiliseurs du groupe choisi dans la config
$validator = new UserGroup($db);
$excludefilter=$user->admin?'':'u.rowid <> '.$user->id;
$valideurobjects = $validator->listUsersForGroup($excludefilter);
@ -1088,6 +1087,7 @@ else
print '<td><textarea name="description" class="flat" rows="'.ROWS_3.'" cols="70">'.$cp->description.'</textarea></td>';
print '</tr>';
}
print '</tbody>';
print '</table>'."\n";
@ -1118,14 +1118,15 @@ else
} else {
print '<tr>';
print '<td width="50%">'.$langs->trans('ReviewedByCP').'</td>';
// Liste des utiliseurs du groupes choisi dans la config
$idGroupValid = $cp->getConfCP('userGroup');
$validator = new UserGroup($db);
$valideur = $validator->listUsersForGroup('',1);
$validator = new UserGroup($db);
$excludefilter=$user->admin?'':'u.rowid <> '.$user->id;
$valideurobjects = $validator->listUsersForGroup($excludefilter);
$valideurarray = array();
foreach($valideurobjects as $val) $valideurarray[$val->id]=$val->id;
print '<td>';
$form->select_users($cp->fk_validator,"valideur",1,"",0,$valideur,'');
print $form->select_dolusers($user->fk_user, "valideur", 1, "", 0, $valideurarray); // By default, hierarchical parent
print '</td>';
print '</tr>';
}

View File

@ -85,18 +85,30 @@ class Holiday extends CommonObject
/**
* updateSold. Update sold and check table of users for holidays is complete. If not complete.
* Update balance of vacations and check table of users for holidays is complete. If not complete.
*
* @return int Return 1
* @return int <0 if KO, >0 if OK
*/
function updateSold()
function updateBalance()
{
// Mets à jour les congés payés en début de mois
$this->updateSoldeCP();
$this->db->begin();
// Vérifie le nombre d'utilisateur et mets à jour si besoin
$this->verifNbUsers($this->countActiveUsersWithoutCP(),$this->getConfCP('nbUser'));
return 1;
// Update sold of vocations
$result = $this->updateSoldeCP();
// Check nb of users into table llx_holiday_users and update with empty lines
//if ($result > 0) $result = $this->verifNbUsers($this->countActiveUsersWithoutCP(), $this->getConfCP('nbUser'));
if ($result >= 0)
{
$this->db->commit();
return 1;
}
else
{
$this->db->rollback();
return -1;
}
}
/**
@ -773,61 +785,6 @@ class Holiday extends CommonObject
}
/**
* Retourne un select HTML des groupes d'utilisateurs
*
* @param string $prefix nom du champ dans le formulaire
* @return string retourne le select des groupes
*/
function selectUserGroup($prefix)
{
// On récupère le groupe déjà configuré
$group.= "SELECT value";
$group.= " FROM ".MAIN_DB_PREFIX."holiday_config";
$group.= " WHERE name = 'userGroup'";
$resultat = $this->db->query($group);
$objet = $this->db->fetch_object($resultat);
$groupe = $objet->value;
// On liste les groupes de Dolibarr
$sql = "SELECT u.rowid, u.nom as name";
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as u";
$sql.= " ORDER BY u.rowid";
dol_syslog(get_class($this)."::selectUserGroup", LOG_DEBUG);
$result = $this->db->query($sql);
// Si pas d'erreur SQL
if ($result)
{
// On créer le select HTML
$selectGroup = '<select name="'.$prefix.'" class="flat">'."\n";
$selectGroup.= '<option value="-1">&nbsp;</option>'."\n";
// On liste les utilisateurs
while ($obj = $this->db->fetch_object($result))
{
if($groupe==$obj->rowid) {
$selectGroup.= '<option value="'.$obj->rowid.'" selected>'.$obj->name.'</option>'."\n";
} else {
$selectGroup.= '<option value="'.$obj->rowid.'">'.$obj->name.'</option>'."\n";
}
}
$selectGroup.= '</select>'."\n";
$this->db->free($result);
}
else
{
// Erreur SQL
$this->error=$this->db->lasterror();
return -1;
}
// Retourne le select HTML
return $selectGroup;
}
/**
* Met à jour une option du module Holiday Payés
*
@ -901,8 +858,9 @@ class Holiday extends CommonObject
// Si mise à jour pour tout le monde en début de mois
$now=dol_now();
// Mois actuel
$month = date('m',$now);
// Get month of last update
$lastUpdate = $this->getConfCP('lastUpdate');
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
//print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;exit;
@ -912,41 +870,52 @@ class Holiday extends CommonObject
{
$this->db->begin();
$users = $this->fetchUsers(false,false);
$nbUser = count($users);
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
$sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
$sql.= " WHERE name = 'lastUpdate'";
$result = $this->db->query($sql);
$typeleaves=$cp->getTypes(1,1);
$typeleaves=$this->getTypes(1,1);
foreach($typeleaves as $key => $val)
{
// On ajoute x jours à chaque utilisateurs
$nb_holiday = $val['newByMonth'];
if (empty($nb_holiday)) $nb_holiday=0;
$users = $this->fetchUsers(false,false);
$nbUser = count($users);
if ($nb_holiday > 0)
{
dol_syslog("We update leavefor everybody for type ".$key, LOG_DEBUG);
$i = 0;
while ($i < $nbUser)
{
$now_holiday = $this->getCPforUser($users[$i]['rowid'], $val['rowid']);
$new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth');
$i = 0;
while ($i < $nbUser)
{
$now_holiday = $this->getCPforUser($users[$i]['rowid'], $val['rowid']);
$new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth');
// On ajoute la modification dans le LOG
$this->addLogCP($user->id, $users[$i]['rowid'], $langs->trans('HolidaysMonthlyUpdate'), $new_solde, $val['rowid']);
// We add a log for each user
$this->addLogCP($user->id, $users[$i]['rowid'], $langs->trans('HolidaysMonthlyUpdate'), $new_solde, $val['rowid']);
$i++;
}
$i++;
}
$sql2 = "UPDATE ".MAIN_DB_PREFIX."holiday_users SET";
$sql2.= " nb_holiday = nb_holiday + ".$nb_holiday;
$sql2.= " WHERE fk_type = ".$val['rowid'];
// Now we update counter for all users at once
$sql2 = "UPDATE ".MAIN_DB_PREFIX."holiday_users SET";
$sql2.= " nb_holiday = nb_holiday + ".$nb_holiday;
$sql2.= " WHERE fk_type = ".$val['rowid'];
$result= $this->db->query($sql2);
$result= $this->db->query($sql2);
if (! $result) break;
if (! $result)
{
dol_print_error($this->db);
break;
}
}
else dol_syslog("No change for leave of type ".$key, LOG_DEBUG);
}
if ($result)
@ -1127,17 +1096,16 @@ class Holiday extends CommonObject
}
/**
* Liste la liste des utilisateurs du module congés
* uniquement pour vérifier si il existe de nouveau utilisateur
* Get list of Users or list of vacation balance.
*
* @param boolean $liste si vrai retourne une liste, si faux retourne un array
* @param boolean $type si vrai retourne pour Dolibarr, si faux retourne pour CP
* @return string retourne un tableau de tout les utilisateurs actifs
* @param boolean $stringlist If true return a string list of id. If false, return an array
* @param boolean $type If true, read Dolibarr user list, if false, return vacation balance list.
* @return array|string|int Return an array
*/
function fetchUsers($liste=true,$type=true)
function fetchUsers($stringlist=true,$type=true)
{
// Si vrai donc pour user Dolibarr
if ($liste)
if ($stringlist)
{
if($type)
{
@ -1155,23 +1123,23 @@ class Holiday extends CommonObject
$i = 0;
$num = $this->db->num_rows($resql);
$liste = '';
$stringlist = '';
// Boucles du listage des utilisateurs
while($i < $num) {
while($i < $num)
{
$obj = $this->db->fetch_object($resql);
if($i == 0) {
$liste.= $obj->rowid;
$stringlist.= $obj->rowid;
} else {
$liste.= ', '.$obj->rowid;
$stringlist.= ', '.$obj->rowid;
}
$i++;
}
// Retoune le tableau des utilisateurs
return $liste;
return $stringlist;
}
else
{
@ -1182,9 +1150,10 @@ class Holiday extends CommonObject
}
else
{ // Si utilisateur du module Congés Payés
$sql = "SELECT u.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as u";
{
// We want only list of user id
$sql = "SELECT DISTINCT cpu.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu";
dol_syslog(get_class($this)."::fetchUsers", LOG_DEBUG);
$resql=$this->db->query($sql);
@ -1194,26 +1163,26 @@ class Holiday extends CommonObject
$i = 0;
$num = $this->db->num_rows($resql);
$liste = '';
$stringlist = '';
// Boucles du listage des utilisateurs
while($i < $num) {
while($i < $num)
{
$obj = $this->db->fetch_object($resql);
if($i == 0) {
$liste.= $obj->fk_user;
$stringlist.= $obj->fk_user;
} else {
$liste.= ', '.$obj->fk_user;
$stringlist.= ', '.$obj->fk_user;
}
$i++;
}
// Retoune le tableau des utilisateurs
return $liste;
return $stringlist;
}
else
{
{
// Erreur SQL
$this->error="Error ".$this->db->lasterror();
return -1;
@ -1224,7 +1193,7 @@ class Holiday extends CommonObject
else
{ // Si faux donc user Congés Payés
// Si c'est pour les utilisateurs de Dolibarr
// List for Dolibarr users
if ($type)
{
$sql = "SELECT u.rowid, u.lastname, u.firstname";
@ -1235,8 +1204,8 @@ class Holiday extends CommonObject
$resql=$this->db->query($sql);
// Si pas d'erreur SQL
if ($resql) {
if ($resql)
{
$i = 0;
$tab_result = $this->holiday;
$num = $this->db->num_rows($resql);
@ -1248,7 +1217,10 @@ class Holiday extends CommonObject
$tab_result[$i]['rowid'] = $obj->rowid;
$tab_result[$i]['name'] = $obj->lastname;
$tab_result[$i]['lastname'] = $obj->lastname;
$tab_result[$i]['firstname'] = $obj->firstname;
$tab_result[$i]['type'] = $obj->type;
$tab_result[$i]['nb_holiday'] = $obj->nb_holiday;
$i++;
}
@ -1256,18 +1228,16 @@ class Holiday extends CommonObject
return $tab_result;
}
else
{
{
// Erreur SQL
$this->error="Error ".$this->db->lasterror();
return -1;
}
// Si c'est pour les utilisateurs du module Congés Payés
}
else
{
$sql = "SELECT DISTINCT cpu.fk_user, u.lastname, u.firstname";
// List of vacation balance users
$sql = "SELECT cpu.fk_user, cpu.fk_type, cpu.nb_holiday, u.lastname, u.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu,";
$sql.= " ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE cpu.fk_user = u.rowid";
@ -1276,20 +1246,23 @@ class Holiday extends CommonObject
$resql=$this->db->query($sql);
// Si pas d'erreur SQL
if ($resql) {
if ($resql)
{
$i = 0;
$tab_result = $this->holiday;
$num = $this->db->num_rows($resql);
// Boucles du listage des utilisateurs
while($i < $num) {
while($i < $num)
{
$obj = $this->db->fetch_object($resql);
$tab_result[$i]['rowid'] = $obj->fk_user;
$tab_result[$i]['name'] = $obj->lastname;
$tab_result[$i]['lastname'] = $obj->lastname;
$tab_result[$i]['firstname'] = $obj->firstname;
$tab_result[$i]['type'] = $obj->type;
$tab_result[$i]['nb_holiday'] = $obj->nb_holiday;
$i++;
}
@ -1297,7 +1270,7 @@ class Holiday extends CommonObject
return $tab_result;
}
else
{
{
// Erreur SQL
$this->error="Error ".$this->db->lasterror();
return -1;
@ -1311,16 +1284,16 @@ class Holiday extends CommonObject
*
* @return int retourne le nombre d'utilisateur
*/
function countActiveUsers() {
function countActiveUsers()
{
$sql = "SELECT count(u.rowid) as compteur";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.statut > 0";
$result = $this->db->query($sql);
$objet = $this->db->fetch_object($result);
return $objet->compteur;
return $objet->compteur;
}
/**
* Compte le nombre d'utilisateur actifs dans Dolibarr sans CP
@ -1331,12 +1304,12 @@ class Holiday extends CommonObject
$sql = "SELECT count(u.rowid) as compteur";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u LEFT OUTER JOIN ".MAIN_DB_PREFIX."holiday_users hu ON (hu.fk_user=u.rowid)";
$sql.= " WHERE u.statut > 0 AND hu.fk_user IS NULL ";
$sql.= " WHERE u.statut > 0 AND hu.fk_user IS NULL";
$result = $this->db->query($sql);
$objet = $this->db->fetch_object($result);
return $objet->compteur;
return $objet->compteur;
}
/**
@ -1344,19 +1317,19 @@ class Holiday extends CommonObject
*
* @param int $userDolibarrWithoutCP Number of active users in Dolibarr without holidays
* @param int $userCP Number of active users into table of holidays
* @return void
* @return int <0 if KO, >0 if OK
*/
function verifNbUsers($userDolibarrWithoutCP,$userCP)
function verifNbUsers($userDolibarrWithoutCP, $userCP)
{
if (empty($userCP)) $userCP=0;
dol_syslog(get_class($this).'::verifNbUsers userDolibarr='.$userDolibarrWithoutCP.' userCP='.$userCP);
/*
// On vérifie les users Dolibarr sans CP
if ($userDolibarrWithoutCP > 0)
{
$this->db->begin();
$this->updateConfCP('nbUser',$userDolibarrWithoutCP);
//$this->updateConfCP('nbUser',$userDolibarrWithoutCP);
$listUsersCP = $this->fetchUsers(true,false);
@ -1436,7 +1409,8 @@ class Holiday extends CommonObject
return -1;
}
}
*/
return 1;
}

View File

@ -39,6 +39,8 @@ $action=GETPOST('action');
$holiday = new Holiday($db);
$langs->load('users');
/*
* Actions
@ -100,7 +102,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
}
}
if (! $error) setEventMessage($langs->trans('UpdateConfCPOK'));
if (! $error) setEventMessages($langs->trans('UpdateConfCPOK'), '', 'mesgs');
}
elseif($action == 'add_event')
{
@ -120,7 +122,7 @@ elseif($action == 'add_event')
if ($error)
{
setEventMessage($langs->trans('ErrorAddEventToUserCP'), 'errors');
setEventMessages($langs->trans('ErrorAddEventToUserCP'), '', 'errors');
}
else
{
@ -133,7 +135,7 @@ elseif($action == 'add_event')
$holiday->updateSoldeCP($userCP,$new_holiday);
setEventMessage($langs->trans('AddEventToUserOkCP'));
setEventMessages($langs->trans('AddEventToUserOkCP'), '', 'mesgs');
}
}
@ -145,13 +147,20 @@ elseif($action == 'add_event')
$form = new Form($db);
$userstatic=new User($db);
$langs->load('users');
llxHeader(array(),$langs->trans('CPTitreMenu'));
print_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png');
$holiday->updateSold(); // Create users into table holiday if they don't exists. TODO Remove if we use field into table user.
print '<div class="info">'.$langs->trans('LastUpdateCP').': '."\n";
if ($holiday->getConfCP('lastUpdate')) print '<strong>'.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')),'dayhour','tzuser').'</strong>';
else print $langs->trans('None');
print "</div><br>\n";
$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user.
if ($result < 0)
{
setEventMessages($holiday->error, $holiday->errors, 'errors');
}
$listUsers = $holiday->fetchUsers(false,true);

236
htdocs/holiday/document.php Normal file
View File

@ -0,0 +1,236 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* 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/holiday/document.php
* \ingroup fichinter
* \brief Page des documents joints sur les contrats
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$langs->load("other");
$langs->load("holidays");
$langs->load("companies");
$id = GETPOST('id','int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'holiday', $id, 'holiday');
// Get parameters
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$object = new Holiday($db);
$object->fetch($id, $ref);
$upload_dir = $conf->holiday->dir_output.'/'.get_exdir($object->id, 0, 0, 0, $object, 'holiday').dol_sanitizeFileName($object->ref);
$modulepart='holiday';
/*
* Actions
*/
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
* View
*/
$form = new Form($db);
$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon"));
llxHeader("","",$langs->trans("InterventionCard"));
if ($object->id)
{
$valideur = new User($db);
$valideur->fetch($object->fk_validator);
$userRequest = new User($db);
$userRequest->fetch($object->fk_user);
$head=holiday_prepare_head($object);
dol_fiche_head($head, 'documents',$langs->trans("CPTitreMenu"),0,'holiday');
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
$totalsize+=$file['size'];
}
print '<table class="border" width="100%">';
$linkback='';
print '<tr>';
print '<td width="25%">'.$langs->trans("Ref").'</td>';
print '<td>';
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref');
print '</td>';
print '</tr>';
print '<td>'.$langs->trans("User").'</td>';
print '<td>';
print $userRequest->getNomUrl(1);
print '</td></tr>';
// Type
print '<tr>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td>';
$typeleaves=$object->getTypes(1,1);
print $typeleaves[$object->fk_type]['label'];
print '</td>';
print '</tr>';
$starthalfday=($object->halfday == -1 || $object->halfday == 2)?'afternoon':'morning';
$endhalfday=($object->halfday == 1 || $object->halfday == 2)?'morning':'afternoon';
if(!$edit)
{
print '<tr>';
print '<td>'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
print '<td>'.dol_print_date($object->date_debut,'day');
print ' &nbsp; &nbsp; ';
print $langs->trans($listhalfday[$starthalfday]);
print '</td>';
print '</tr>';
}
else
{
print '<tr>';
print '<td>'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
print '<td>';
$form->select_date($object->date_debut,'date_debut_');
print ' &nbsp; &nbsp; ';
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday')?GETPOST('starthalfday'):$starthalfday));
print '</td>';
print '</tr>';
}
if (!$edit)
{
print '<tr>';
print '<td>'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
print '<td>'.dol_print_date($object->date_fin,'day');
print ' &nbsp; &nbsp; ';
print $langs->trans($listhalfday[$endhalfday]);
print '</td>';
print '</tr>';
}
else
{
print '<tr>';
print '<td>'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
print '<td>';
$form->select_date($object->date_fin,'date_fin_');
print ' &nbsp; &nbsp; ';
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday')?GETPOST('endhalfday'):$endhalfday));
print '</td>';
print '</tr>';
}
print '<tr>';
print '<td>'.$langs->trans('NbUseDaysCP').'</td>';
print '<td>'.num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday).'</td>';
print '</tr>';
// Status
print '<tr>';
print '<td>'.$langs->trans('StatutCP').'</td>';
print '<td>'.$object->getLibStatut(2).'</td>';
print '</tr>';
if ($object->statut == 5)
{
print '<tr>';
print '<td>'.$langs->trans('DetailRefusCP').'</td>';
print '<td>'.$object->detail_refuse.'</td>';
print '</tr>';
}
// Description
if (!$edit)
{
print '<tr>';
print '<td>'.$langs->trans('DescCP').'</td>';
print '<td>'.nl2br($object->description).'</td>';
print '</tr>';
}
else
{
print '<tr>';
print '<td>'.$langs->trans('DescCP').'</td>';
print '<td><textarea name="description" class="flat" rows="'.ROWS_3.'" cols="70">'.$object->description.'</textarea></td>';
print '</tr>';
}
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
dol_fiche_end();
$modulepart = 'holiday';
$permission = $user->rights->holiday->write;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{
print $langs->trans("ErrorUnknown");
}
llxFooter();
$db->close();

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
@ -96,7 +96,7 @@ $holidaystatic=new Holiday($db);
$fuser = new User($db);
// Update sold
$holiday->updateSold();
$result = $holiday->updateBalance();
$max_year = 5;
$min_year = 10;
@ -187,7 +187,7 @@ if ($id > 0)
$user_id = $fuser->id;
}
// Récupération des congés payés de l'utilisateur ou de tous les users
if (!$user->rights->holiday->write_all || $id > 0)
if (empty($user->rights->holiday->write_all) || $id > 0)
{
$holiday_payes = $holiday->fetchByUser($user_id,$order,$filter); // Load array $holiday->holiday
}
@ -292,13 +292,18 @@ $formother->select_year($year_create,'year_create',1, $min_year, 0);
print '</td>';
// UTILISATEUR
if($user->rights->holiday->write_all)
if ($user->rights->holiday->write_all)
{
print '<td class="liste_titre" align="left">';
print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,32);
print '</td>';
} else {
print '<td class="liste_titre">&nbsp;</td>';
}
else
{
//print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left">';
print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,32);
print '</td>';
}
// VALIDEUR

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 François Legastelois <flegastelois@teclib.com>
*
* This program is free software; you can redistribute it and/or modify
@ -34,7 +34,7 @@ if ($user->societe_id > 0) accessforbidden();
// Si l'utilisateur n'a pas le droit de lire cette page
if(!$user->rights->holiday->month_report) accessforbidden();
if(!$user->rights->holiday->read_all) accessforbidden();
@ -73,18 +73,24 @@ $num = $db->num_rows($result);
print_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm.png');
print '<div class="tabBar">';
// Get month of last update
$lastUpdate = $cp->getConfCP('lastUpdate', 0);
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
$yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3];
print $langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$yearLastUpdate.'-'.$monthLastUpdate.'</strong><br><br>'."\n";
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
dol_fiche_head();
print $langs->trans('Month').': ';
print $htmlother->select_month($month, 'month_start').' ';
print $htmlother->select_year($year,'year_start',1,10,3);
print '<input type="submit" value="'.$langs->trans("Refresh").'" class="button" />';
print '</form>';
print '<br>';
print '<br>';
$var=true;
@ -137,7 +143,11 @@ if($num == '0') {
}
}
print '</table>';
print '</div>';
dol_fiche_end();
print '</form>';
// Fin de page
llxFooter();

View File

@ -1,124 +0,0 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
*
* 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 define_congespayes.php
* \ingroup congespayes
* \brief File that defines the balance of paid leave of users.
* \version $Id: define_congespayes.php,v 1.00 2011/09/15 11:00:00 dmouillard Exp $
* \author dmouillard@teclib.com <Dimitri Mouillard>
* \remarks File that defines the balance of paid leave of users.
*/
require('../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
// Protection if external user
if ($user->societe_id > 0) accessforbidden();
// If the user does not have perm to read the page
if(!$user->rights->holiday->define_holiday) accessforbidden();
/*
* View
*/
llxHeader(array(),$langs->trans('CPTitreMenu'));
print_fiche_titre($langs->trans('MenuConfCP'));
$congespayes = new Holiday($db);
$listUsers = $congespayes->fetchUsers(false, true);
// Si il y a une action de mise à jour
if (isset($_POST['action']) && $_POST['action'] == 'update') {
$fk_type = $_POST['fk_type'];
foreach ($_POST['nb_conges'] as $user_id => $compteur) {
if (!empty($compteur)) {
$userValue = str_replace(',', '.', $compteur);
$userValue = number_format($userValue, 2, '.', '');
} else {
$userValue = '0.00';
}
$congespayes->updateSoldeCP($user_id,$userValue,$fk_type);
}
print '<div class="tabBar">';
print $langs->trans('UpdateConfCPOK');
print '</div>';
}
$var = true;
$i = 0;
foreach($congespayes->getTypes() as $type)
{
if($type['affect']==1)
{
print '<div class="tabBar" style="float:left;width:300px;margin-right:10px;">';
print '<h3>'.$type['label'].'</h3>';
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
print '<input type="hidden" name="action" value="update" />';
print '<input type="hidden" name="fk_type" value="'.$type['rowid'].'" />';
print '<table class="noborder" width="100%;">';
print "<tr class=\"liste_titre\">";
print '<td width="50%">' . $langs->trans('Employee') . '</td>';
print '<td width="30%">' . $langs->trans('Counter') . '</td>';
print '</tr>';
foreach ($listUsers as $users) {
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>' . $users['name'] . ' ' . $users['firstname'] . '</td>';
print '<td>';
print '<input type="text" value="' .
$congespayes->getCPforUser($users['rowid'],$type['rowid']) .
'" name="nb_conges[' . $users['rowid'] . ']"
size="5" style="text-align: center;"/>';
print ' jours</td>' . "\n";
print '</tr>';
$i++;
}
echo "<tr>";
print '<td colspan="2"><input type="submit" value="'
. $langs->trans("UpdateEventOptionCP") .
' ' . $type['label'] .
'" name="bouton" class="button" style="margin: 10px;"></td>';
echo "</tr>";
print '</table>';
print '</form>';
print '</div>';
}
}
// Fin de page
$db->close();
llxFooter();

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if ($user->societe_id > 0) accessforbidden();
// Si l'utilisateur n'a pas le droit de lire cette page
if(!$user->rights->holiday->view_log) accessforbidden();
if(!$user->rights->holiday->read_all) accessforbidden();
$year=GETPOST('year');
if (empty($year))
@ -41,22 +41,27 @@ if (empty($year))
$year=$tmpdate['year'];
}
$langs->load('users');
/*
* View
*/
$langs->load('users');
$cp = new Holiday($db);
llxHeader(array(),$langs->trans('CPTitreMenu').' ('.$langs->trans("Year").' '.$year.')');
$cp = new Holiday($db);
// Recent changes are more important than old changes
$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC', " AND date_action BETWEEN '".$db->idate(dol_get_first_day($year,1,1))."' AND '".$db->idate(dol_get_last_day($year,12,1))."'"); // Load $cp->logs
print load_fiche_titre($langs->trans('LogCP'), '<div class="pagination"><ul><li class="pagination"><a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'">&lt;</a><li class="pagination"><a href="">'.$langs->trans("Year").' '.$year.'</a></li><li class="pagination"><a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'">&gt;</a></li></lu></div>', 'title_hrm.png');
print '<div class="info">'.$langs->trans('LastUpdateCP').': '."\n";
if ($cp->getConfCP('lastUpdate')) print '<strong>'.dol_print_date($db->jdate($cp->getConfCP('lastUpdate')),'dayhour','tzuser').'</strong>';
else print $langs->trans('None');
print "</div><br>\n";
print '<table class="noborder" width="100%">';
print '<tbody>';
print '<tr class="liste_titre">';
@ -107,6 +112,6 @@ print '</tbody>'."\n";
print '</table>'."\n";
// Fin de page
$db->close();
llxFooter();
$db->close();

View File

@ -24,10 +24,13 @@
-- de l'install et tous les sigles '--' sont supprimés.
--
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country) values ('LEAVE_PAID', 'Paid vacation', 1, 7, 0, NULL);
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country) values ('LEAVE_SICK', 'Sick leave', 0, 0, 0, NULL);
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country) values ('LEAVE_OTHER','Other leave', 0, 0, 0, NULL);
-- Generic to all countries
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_SICK', 'Sick leave', 0, 0, 0, NULL, 1);
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_OTHER', 'Other leave', 0, 0, 0, NULL, 1);
-- Not enabled by default, we prefer to have an entrey dedicated to country
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_PAID', 'Paid vacation', 1, 7, 0, NULL, 0);
-- Leaves specific to France
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country) values ('LEAVE_RTT', 'RTT' , 1, 7, 0.83, 1);
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_RTT_FR', 'RTT' , 1, 7, 0.83, 1, 1);
insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_PAID_FR', 'Paid vacation', 1, 30, 2.08334, 1, 1);

View File

@ -1,8 +1 @@
INSERT INTO llx_holiday_config (name ,value) VALUES ('userGroup', NULL);
INSERT INTO llx_holiday_config (name ,value) VALUES ('lastUpdate', NULL);
INSERT INTO llx_holiday_config (name ,value) VALUES ('nbUser', NULL);
INSERT INTO llx_holiday_config (name ,value) VALUES ('delayForRequest', '31');
INSERT INTO llx_holiday_config (name ,value) VALUES ('AlertValidatorDelay', '0');
INSERT INTO llx_holiday_config (name ,value) VALUES ('AlertValidatorSolde', '0');
INSERT INTO llx_holiday_config (name ,value) VALUES ('nbHolidayDeducted', '1');
INSERT INTO llx_holiday_config (name ,value) VALUES ('nbHolidayEveryMonth', '2.08334');

View File

@ -364,7 +364,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
{
migrate_event_assignement($db,$langs,$conf);
}
// Scripts for lat version
$afterversionarray=explode('.','3.7.9');
$beforeversionarray=explode('.','3.8.9');
@ -381,6 +381,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
'MAIN_MODULE_ECM',
'MAIN_MODULE_FACTURE',
'MAIN_MODULE_FOURNISSEUR',
'MAIN_MODULE_HOLIDAY',
'MAIN_MODULE_OPENSURVEY',
'MAIN_MODULE_PAYBOX',
'MAIN_MODULE_PRODUIT',
@ -3824,7 +3825,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$mod=new modService($db);
@ -3835,7 +3836,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$mod=new modCommande($db);

View File

@ -1,5 +1,12 @@
# Dolibarr language file - en_US - Accounting Expert
CHARSET=UTF-8
ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file
ACCOUNTING_EXPORT_DATE=Date format for export file
ACCOUNTING_EXPORT_PIECE=Export the number of piece ?
ACCOUNTING_EXPORT_GLOBAL_ACCOUNT=Export with global account ?
ACCOUNTING_EXPORT_LABEL=Export the label ?
ACCOUNTING_EXPORT_AMOUNT=Export the amount ?
ACCOUNTING_EXPORT_DEVISE=Export the devise ?
Accounting=Accounting
Globalparameters=Global parameters
@ -81,9 +88,8 @@ ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts
ACCOUNTING_SELL_JOURNAL=Sell journal
ACCOUNTING_PURCHASE_JOURNAL=Purchase journal
ACCOUNTING_BANK_JOURNAL=Bank journal
ACCOUNTING_CASH_JOURNAL=Cash journal
ACCOUNTING_MISCELLANEOUS_JOURNAL=Miscellaneous journal
ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal
ACCOUNTING_SOCIAL_JOURNAL=Social journal
ACCOUNTING_ACCOUNT_TRANSFER_CASH=Account of transfer

File diff suppressed because it is too large Load Diff

View File

@ -94,12 +94,12 @@ Conciliate=التوفيق
Conciliation=توفيق
ConciliationForAccount=التوفيق في هذا الحساب
IncludeClosedAccount=وتشمل حسابات مغلقة
OnlyOpenedAccount=إلا فتح حسابات
OnlyOpenedAccount=Only open accounts
AccountToCredit=الحساب على الائتمان
AccountToDebit=لحساب الخصم
DisableConciliation=تعطيل ميزة التوفيق لهذا الحساب
ConciliationDisabled=توفيق سمة المعوقين
StatusAccountOpened=فتح
StatusAccountOpened=Open
StatusAccountClosed=مغلقة
AccountIdShort=عدد
EditBankRecord=تعديل السجل

View File

@ -298,6 +298,7 @@ RelatedCustomerInvoices=Related customer invoices
RelatedSupplierInvoices=Related supplier invoices
LatestRelatedBill=Latest related invoice
WarningBillExist=Warning, one or more invoice already exist
MergingPDFTool=Merging PDF tool
# PaymentConditions
PaymentConditionShortRECEP=فورا
@ -429,5 +430,5 @@ NotLastInCycle=This invoice in not the last in cycle and must not be modified.
DisabledBecauseNotLastInCycle=The next situation already exists.
DisabledBecauseFinal=This situation is final.
CantBeLessThanMinPercent=The progress can't be smaller than its value in the previous situation.
NoSituations=No opened situations
NoSituations=No open situations
InvoiceSituationLast=Final and general invoice

View File

@ -19,7 +19,7 @@ BoxLastContracts=آخر العقود
BoxLastContacts=مشاركة اتصالات / عناوين
BoxLastMembers=مشاركة الأعضاء
BoxFicheInter=Last interventions
BoxCurrentAccounts=Opened accounts balance
BoxCurrentAccounts=Open accounts balance
BoxSalesTurnover=مبيعات
BoxTotalUnpaidCustomerBills=مجموع الفواتير غير المدفوعة للعميل
BoxTotalUnpaidSuppliersBills=مجموع الفواتير غير المدفوعة المورد
@ -47,7 +47,7 @@ BoxTitleLastModifiedMembers=Last %s members
BoxTitleLastFicheInter=Last %s modified intervention
BoxTitleOldestUnpaidCustomerBills=Oldest %s unpaid customer invoices
BoxTitleOldestUnpaidSupplierBills=Oldest %s unpaid supplier invoices
BoxTitleCurrentAccounts=Opened account's balances
BoxTitleCurrentAccounts=Open accounts balances
BoxTitleSalesTurnover=مبيعات
BoxTitleTotalUnpaidCustomerBills=Unpaid customer invoices
BoxTitleTotalUnpaidSuppliersBills=Unpaid supplier invoices

View File

@ -42,19 +42,19 @@ ImpossibleAddCat=Impossible to add the tag/category
ImpossibleAssociateCategory=Impossible to associate the tag/category to
WasAddedSuccessfully=<b>ق ٪</b> أضيفت بنجاح.
ObjectAlreadyLinkedToCategory=Element is already linked to this tag/category.
CategorySuccessfullyCreated=This tag/category %s has been added with success.
ProductIsInCategories=Product/service owns to following tags/categories
SupplierIsInCategories=Third party owns to following suppliers tags/categories
CompanyIsInCustomersCategories=This third party owns to following customers/prospects tags/categories
CompanyIsInSuppliersCategories=This third party owns to following suppliers tags/categories
MemberIsInCategories=This member owns to following members tags/categories
ContactIsInCategories=This contact owns to following contacts tags/categories
CategorySuccessfullyCreated=This tag/category %s has been added successfully.
ProductIsInCategories=Product/service is linked to following tags/categories
SupplierIsInCategories=Third party is linked to following suppliers tags/categories
CompanyIsInCustomersCategories=This third party is linked to following customers/prospects tags/categories
CompanyIsInSuppliersCategories=This third party is linked to following suppliers tags/categories
MemberIsInCategories=This member is linked to following members tags/categories
ContactIsInCategories=This contact is linked to following contacts tags/categories
ProductHasNoCategory=This product/service is not in any tags/categories
SupplierHasNoCategory=This supplier is not in any tags/categories
CompanyHasNoCategory=This thirdparty is not in any tags/categories
MemberHasNoCategory=This member is not in any tags/categories
ContactHasNoCategory=This contact is not in any tags/categories
ClassifyInCategory=Classify in tag/category
ClassifyInCategory=Add to tag/category
NoneCategory=بلا
NotCategorized=Without tag/category
CategoryExistsAtSameLevel=هذه الفئة موجودة بالفعل في نفس المكان
@ -67,13 +67,13 @@ ContentsNotVisibleByAllShort=محتويات غير مرئي من قبل جميع
CategoriesTree=Tags/categories tree
DeleteCategory=Delete tag/category
ConfirmDeleteCategory=Are you sure you want to delete this tag/category ?
RemoveFromCategory=Remove link with tag/categorie
RemoveFromCategoryConfirm=Are you sure you want to remove link between the transaction and the tag/category ?
RemoveFromCategory=Remove link with tag/category
RemoveFromCategoryConfirm=Are you sure you want to unlink the transaction from the tag/category ?
NoCategoriesDefined=No tag/category defined
SuppliersCategoryShort=Suppliers tags/category
CustomersCategoryShort=Customers tags/category
ProductsCategoryShort=Products tags/category
MembersCategoryShort=Members tags/category
SuppliersCategoryShort=Suppliers tag/category
CustomersCategoryShort=Customers tag/category
ProductsCategoryShort=Products tag/category
MembersCategoryShort=Members tag/category
SuppliersCategoriesShort=Suppliers tags/categories
CustomersCategoriesShort=Customers tags/categories
CustomersProspectsCategoriesShort=Custo. / Prosp. الفئات

View File

@ -259,8 +259,8 @@ AvailableGlobalDiscounts=مطلق الخصومات المتاحة
DiscountNone=بلا
Supplier=المورد
CompanyList=شركات قائمة
AddContact=إضافة
AddContactAddress=Add contact/address
AddContact=Create contact
AddContactAddress=Create contact/address
EditContact=تحرير الاتصال / عنوان
EditContactAddress=Edit contact/address
Contact=جهة اتصال
@ -268,8 +268,8 @@ ContactsAddresses=اتصالات / عناوين
NoContactDefinedForThirdParty=No contact defined for this third party
NoContactDefined=لا يوجد اتصال محددة لهذا الطرف الثالث
DefaultContact=الاتصال الافتراضية
AddCompany=إضافة شركة
AddThirdParty=إضافة طرف ثالث
AddCompany=Create company
AddThirdParty=Create third party
DeleteACompany=حذف شركة
PersonalInformations=البيانات الشخصية
AccountancyCode=قانون المحاسبة
@ -379,8 +379,8 @@ DeliveryAddressLabel=تسليم بطاقة معالجة
DeleteDeliveryAddress=حذف عنوان التسليم
ConfirmDeleteDeliveryAddress=هل أنت متأكد من أنك تريد حذف هذا عنوان التسليم؟
NewDeliveryAddress=تقديم معالجة جديدة
AddDeliveryAddress=أضف معالجة
AddAddress=أضف معالجة
AddDeliveryAddress=Create address
AddAddress=Create address
NoOtherDeliveryAddress=لا بديل عن تقديم معالجة محددة
SupplierCategory=المورد الفئة
JuridicalStatus200=المستقلة
@ -410,5 +410,10 @@ OutstandingBillReached=Reached max. for outstanding bill
MonkeyNumRefModelDesc=عودة número مع الشكل nnnn - ٪ syymm الزبون ورمز وnnnn - ٪ syymm مورد للقانون حيث السنة هو السنة ، هو شهر ملم وnnnn هو تسلسل بلا كسر وعدم العودة إلى 0.
LeopardNumRefModelDesc=العميل / المورد مدونة مجانية. هذا القانون يمكن تعديلها في أي وقت.
ManagingDirectors=Manager(s) name (CEO, director, president...)
SearchThirdparty=Search thirdparty
SearchThirdparty=Search third party
SearchContact=Search contact
MergeOriginThirdparty=Duplicate third party (third party you want to delete)
MergeThirdparties=Merge third parties
ConfirmMergeThirdparties=Are you sure you want to merge this third party into the current one ? All linked objects (invoices, orders, ...) will be moved to current third party so you will be able to delete the duplicate one.
ThirdpartiesMergeSuccess=Thirdparties have been merged
ErrorThirdpartiesMerge=There was an error when deleting the thirdparties. Please check the log. Changes have been reverted.

View File

@ -4,10 +4,10 @@ About = حول
CronAbout = About Cron
CronAboutPage = Cron about page
# Right
Permission23101 = Read Scheduled task
Permission23102 = Create/update Scheduled task
Permission23103 = Delete Scheduled task
Permission23104 = Execute Scheduled task
Permission23101 = Read Scheduled job
Permission23102 = Create/update Scheduled job
Permission23103 = Delete Scheduled job
Permission23104 = Execute Scheduled job
# Admin
CronSetup= Scheduled job management setup
URLToLaunchCronJobs=URL to check and launch cron jobs if required
@ -26,11 +26,11 @@ CronLastOutput=Last run output
CronLastResult=Last result code
CronListOfCronJobs=List of scheduled jobs
CronCommand=Command
CronList=Scheduled job
CronList=Scheduled jobs
CronDelete=Delete scheduled jobs
CronConfirmDelete=Are you sure you want to delete this scheduled jobs ?
CronConfirmDelete=Are you sure you want to delete these scheduled jobs ?
CronExecute=Launch scheduled jobs
CronConfirmExecute=Are you sure to execute this scheduled jobs now ?
CronConfirmExecute=Are you sure you want to execute these scheduled jobs now ?
CronInfo=Scheduled job module allow to execute job that have been planned
CronWaitingJobs=Waiting jobs
CronTask=Job
@ -39,8 +39,8 @@ CronDtStart=تاريخ البدء
CronDtEnd=نهاية التاريخ
CronDtNextLaunch=Next execution
CronDtLastLaunch=Last execution
CronFrequency=Frequancy
CronClass=Classe
CronFrequency=Frequency
CronClass=Class
CronMethod=الطريقة
CronModule=وحدة
CronAction=Action
@ -55,9 +55,9 @@ CronEach=Every
JobFinished=Job launched and finished
#Page card
CronAdd= Add jobs
CronHourStart= Start Hour and date of task
CronEvery= And execute task each
CronObject= Instance/Object to create
CronHourStart= Start hour and date of job
CronEvery=Execute job each
CronObject=Instance/Object to create
CronArgs=البارامترات
CronSaveSucess=Save succesfully
CronNote=التعليق
@ -79,10 +79,10 @@ CronCreateJob=Create new Scheduled Job
# Info
CronInfoPage=Information
# Common
CronType=Task type
CronType=Job type
CronType_method=Call method of a Dolibarr Class
CronType_command=Shell command
CronMenu=Cron
CronCannotLoadClass=Cannot load class %s or object %s
UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Modules tools - Job list" to see and edit scheduled jobs.
TaskDisabled=Task disabled
TaskDisabled=Job disabled

View File

@ -170,6 +170,7 @@ ErrorGlobalVariableUpdater4=SOAP client failed with error '%s'
ErrorGlobalVariableUpdater5=No global variable selected
ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided
# Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@ -1,5 +1,5 @@
Module210009Name=Incoterm
Module210009Desc=Add features to manage Incoterm
Module62000Name=Incoterm
Module62000Desc=Add features to manage Incoterm
IncotermLabel=Incoterms
IncotermSetupTitle1=Feature
IncotermSetupTitle2=Status

View File

@ -2,6 +2,7 @@
Language_ar_AR=العربية
Language_ar_SA=العربية
Language_bn_BD=Bengali
Language_bg_BG=Bulgarian
Language_bs_BA=Bosnian
Language_ca_ES=كاتالاني
@ -21,9 +22,10 @@ Language_en_SA=English (Saudi Arabia)
Language_en_US=الإنكليزية (الولايات المتحدة)
Language_en_ZA=English (South Africa)
Language_es_ES=الأسبانية
Language_es_DO=Spanish (Dominican Republic)
Language_es_AR=الأسبانية (الأرجنتين)
Language_es_CL=Spanish (Chile)
Language_es_CO=Spanish (Colombia)
Language_es_DO=Spanish (Dominican Republic)
Language_es_HN=الأسبانية (هندوراس)
Language_es_MX=الإسبانية (المكسيك)
Language_es_PY=Spanish (Paraguay)
@ -45,7 +47,10 @@ Language_id_ID=Indonesian
Language_is_IS=الآيسلندي
Language_it_IT=الإيطالي
Language_ja_JP=اليابانية
Language_ka_GE=Georgian
Language_kn_IN=Kannada
Language_ko_KR=Korean
Language_lo_LA=Lao
Language_lt_LT=Lithuanian
Language_lv_LV=Latvian
Language_mk_MK=Macedonian
@ -64,6 +69,7 @@ Language_sv_SV=السويدية
Language_sv_SE=السويدية
Language_sq_AL=Albanian
Language_sk_SK=Slovakian
Language_sw_SW=Kiswahili
Language_th_TH=Thai
Language_uk_UA=Ukrainian
Language_uz_UZ=Uzbek

View File

@ -77,7 +77,7 @@ CheckRead=Read Receipt
YourMailUnsubcribeOK=The email <b>%s</b> is correctly unsubcribe from mailing list
MailtoEMail=Hyper link to email
ActivateCheckRead=Allow to use the "Unsubcribe" link
ActivateCheckReadKey=Key use to encrypt URL use for "Read Receipt" and "Unsubcribe" feature
ActivateCheckReadKey=Key used to encrypt URL used for "Read Receipt" and "Unsubcribe" feature
EMailSentToNRecipients=EMail sent to %s recipients.
XTargetsAdded=<b>%s</b> recipients added into target list
EachInvoiceWillBeAttachedToEmail=A document using default invoice document template will be created and attached to each email.

View File

@ -301,7 +301,7 @@ UnitPriceHT=سعر الوحدة (صافي)
UnitPriceTTC=سعر الوحدة
PriceU=ارتفاع
PriceUHT=ارتفاع (صافي)
AskPriceSupplierUHT=P.U. HT Requested
AskPriceSupplierUHT=U.P. net Requested
PriceUTTC=ارتفاع
Amount=مبلغ
AmountInvoice=مبلغ الفاتورة
@ -413,6 +413,8 @@ Qty=الكمية
ChangedBy=تغيير
ApprovedBy=Approved by
ApprovedBy2=Approved by (second approval)
Approved=Approved
Refused=Refused
ReCalculate=Recalculate
ResultOk=النجاح
ResultKo=فشل
@ -421,7 +423,7 @@ Reportings=الإبلاغ
Draft=مسودة
Drafts=المسودات
Validated=صادق
Opened=فتح
Opened=Open
New=جديد
Discount=الخصم
Unknown=غير معروف
@ -678,6 +680,7 @@ LinkedToSpecificUsers=Linked to a particular user contact
DeleteAFile=Delete a file
ConfirmDeleteAFile=Are you sure you want to delete file
NoResults=No results
SystemTools=System tools
ModulesSystemTools=Modules tools
Test=Test
Element=Element
@ -703,6 +706,9 @@ ShowTransaction=Show transaction
GoIntoSetupToChangeLogo=Go into Home - Setup - Company to change logo or go into Home - Setup - Display to hide.
Deny=Deny
Denied=Denied
ListOfTemplates=List of templates
Genderman=Man
Genderwoman=Woman
# Week day
Monday=يوم الاثنين
Tuesday=الثلاثاء
@ -732,3 +738,4 @@ ShortThursday=تي
ShortFriday=واو
ShortSaturday=دإ
ShortSunday=دإ
SelectMailModel=Select email template

View File

@ -16,14 +16,14 @@ SupplierOrder=من أجل المورد
SuppliersOrders=الموردين أوامر
SuppliersOrdersRunning=الحالية الموردين أوامر
CustomerOrder=عملاء النظام
CustomersOrders=Customers orders
CustomersOrdersRunning=الحالية الزبائن
CustomersOrdersAndOrdersLines=أوامر العملاء وأوامر خطوط
OrdersToValid=Customers orders to validate
OrdersToBill=Customers orders delivered
OrdersInProcess=Customers orders in process
OrdersToProcess=Customers orders to process
SuppliersOrdersToProcess=المورد أوامر لمعالجة
CustomersOrders=Customer orders
CustomersOrdersRunning=Current customer orders
CustomersOrdersAndOrdersLines=Customer orders and order lines
OrdersToValid=Customer orders to validate
OrdersToBill=Customer orders delivered
OrdersInProcess=Customer orders in process
OrdersToProcess=Customer orders to process
SuppliersOrdersToProcess=Supplier orders to process
StatusOrderCanceledShort=ألغى
StatusOrderDraftShort=مسودة
StatusOrderValidatedShort=صادق
@ -75,8 +75,9 @@ AddToMyOrders=أضف إلى أوامر
AddToOtherOrders=إضافة إلى أوامر أخرى
AddToDraftOrders=Add to draft order
ShowOrder=وتبين من أجل
NoOpenedOrders=أي أوامر فتح
NoOtherOpenedOrders=أي أوامر فتح
OrdersOpened=Orders to process
NoOpenedOrders=No open orders
NoOtherOpenedOrders=No other open orders
NoDraftOrders=No draft orders
OtherOrders=أوامر أخرى
LastOrders=Last %s customer orders

View File

@ -12,6 +12,7 @@ Notify_FICHINTER_VALIDATE=تدخل المصادق
Notify_FICHINTER_SENTBYMAIL=Intervention sent by mail
Notify_BILL_VALIDATE=فاتورة مصادق
Notify_BILL_UNVALIDATE=Customer invoice unvalidated
Notify_ORDER_SUPPLIER_VALIDATE=Supplier order recorded
Notify_ORDER_SUPPLIER_APPROVE=من أجل الموافقة على المورد
Notify_ORDER_SUPPLIER_REFUSE=من أجل رفض الموردين
Notify_ORDER_VALIDATE=التحقق من صحة النظام العميل
@ -203,6 +204,7 @@ ClickHereToGoTo=Click here to go to %s
YouMustClickToChange=You must however first click on the following link to validate this password change
ForgetIfNothing=If you didn't request this change, just forget this email. Your credentials are kept safe.
IfAmountHigherThan=If amount higher than <strong>%s</strong>
SourcesRepository=Repository for sources
##### Calendar common #####
AddCalendarEntry=إضافة الدخول في التقويم ق ٪

View File

@ -1,6 +1,6 @@
# Dolibarr language file - Source file is en_US - printing
Module112000Name=Direct Printing
Module112000Desc=Enable Direct Printing System
Module64000Name=Direct Printing
Module64000Desc=Enable Direct Printing System
PrintingSetup=Setup of Direct Printing System
PrintingDesc=This module adds a Print button to send documents directly to a printer (without opening document into an application) with various module.
ModuleDriverSetup=Setup Module Driver
@ -49,7 +49,6 @@ PRINTIPP_PORT=Port
PRINTIPP_USER=Login
PRINTIPP_PASSWORD=Password
NoPrinterFound=No printers found (check your CUPS setup)
FileWasSentToPrinter=File %s was sent to printer
NoDefaultPrinterDefined=No default printer defined
DefaultPrinter=Default printer
Printer=Printer

View File

@ -19,4 +19,4 @@ printQty=Qty: %d
AddDispatchBatchLine=Add a line for Shelf Life dispatching
BatchDefaultNumber=Undefined
WhenProductBatchModuleOnOptionAreForced=When module Lot/Serial is on, increase/decrease stock mode is forced to last choice and can't be edited. Other options can be defined as you want.
ProductDoesNotUseBatchSerial=This product does not use batch/serial number
ProductDoesNotUseBatchSerial=This product does not use lot/serial number

View File

@ -23,14 +23,14 @@ ProductOrService=المنتج أو الخدمة
ProductsAndServices=المنتجات والخدمات
ProductsOrServices=منتجات أو خدمات
ProductsAndServicesOnSell=Products and Services for sale or for purchase
ProductsAndServicesNotOnSell=Products and Services out of sale
ProductsAndServicesNotOnSell=Products and Services not for sale
ProductsAndServicesStatistics=المنتجات والخدمات والإحصاءات
ProductsStatistics=المنتجات إحصاءات
ProductsOnSell=Product for sale or for pruchase
ProductsNotOnSell=Product out of sale and out of purchase
ProductsOnSell=Product for sale or for purchase
ProductsNotOnSell=Product not for sale and not for purchase
ProductsOnSellAndOnBuy=Products for sale and for purchase
ServicesOnSell=Services for sale or for purchase
ServicesNotOnSell=Services out of sale
ServicesNotOnSell=Services not for sale
ServicesOnSellAndOnBuy=Services for sale and for purchase
InternalRef=إشارة الداخلية
LastRecorded=آخر المنتجات والخدمات المسجلة على بيع
@ -44,7 +44,7 @@ CardProduct1=بطاقة الخدمة
CardContract=عقد بطاقة
Warehouse=مخزن
Warehouses=المستودعات
WarehouseOpened=فتح مخزن
WarehouseOpened=Warehouse open
WarehouseClosed=مخزن مغلق
Stock=الأسهم
Stocks=الاسهم
@ -71,21 +71,21 @@ SellingPriceTTC=سعر البيع (شركة الضريبية)
PublicPrice=السعر العام
CurrentPrice=السعر الحالي
NewPrice=السعر الجديد
MinPrice=القطرة. سعر البيع
MinPriceHT=Minim. selling price (net of tax)
MinPriceTTC=Minim. selling price (inc. tax)
MinPrice=Min. selling price
MinPriceHT=Min. selling price (net of tax)
MinPriceTTC=Min. selling price (inc. tax)
CantBeLessThanMinPrice=سعر البيع لا يمكن أن يكون أقل من الحد الأدنى المسموح لهذا المنتج (٪ ق بدون الضرائب)
ContractStatus=عقد مركز
ContractStatusClosed=مغلقة
ContractStatusRunning=على التوالي
ContractStatusRunning=Ongoing
ContractStatusExpired=انتهى
ContractStatusOnHold=لا تعمل
ContractStatusToRun=To get running
ContractNotRunning=هذا العقد لا تعمل
ContractStatusOnHold=On hold
ContractStatusToRun=Make ongoing
ContractNotRunning=This contract is not ongoing
ErrorProductAlreadyExists=منتج مع الإشارة ٪ ق موجود بالفعل.
ErrorProductBadRefOrLabel=قيمة خاطئة لإشارة أو علامة.
ErrorProductClone=There was a problem while trying to clone the product or service.
ErrorPriceCantBeLowerThanMinPrice=Error Price Can't Be Lower Than Minimum Price.
ErrorPriceCantBeLowerThanMinPrice=Error, price can't be lower than minimum price.
Suppliers=الموردين
SupplierRef=المرجع المورد.
ShowProduct=وتظهر المنتج
@ -117,12 +117,12 @@ ServiceLimitedDuration=إذا كان المنتج هو خدمة لفترة مح
MultiPricesAbility=Several level of prices per product/service
MultiPricesNumPrices=عدد من السعر
MultiPriceLevelsName=سعر الفئات
AssociatedProductsAbility=Activate the virtual package feature
AssociatedProductsAbility=Activate the package feature
AssociatedProducts=Package product
AssociatedProductsNumber=Number of products composing this virtual package product
AssociatedProductsNumber=Number of products composing this package product
ParentProductsNumber=Number of parent packaging product
IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual package product
IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual package product
IfZeroItIsNotAVirtualProduct=If 0, this product is not a package product
IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any package product
EditAssociate=المنتسبون
Translation=الترجمة
KeywordFilter=الكلمة الرئيسية فلتر
@ -131,7 +131,7 @@ ProductToAddSearch=إضافة إلى البحث عن المنتج
AddDel=إضافة / حذف
Quantity=الكمية
NoMatchFound=العثور على أي مباراة
ProductAssociationList=قائمة المنتجات المتعلقة / الخدمات : اسم المنتج / الخدمة (الكمية المتضررة)
ProductAssociationList=List of products/services that are component of this virtual product/package
ProductParentList=List of package products/services with this product as a component
ErrorAssociationIsFatherOfThis=واحد من اختيار المنتج الأم الحالية المنتج
DeleteProduct=حذف المنتجات / الخدمات
@ -179,16 +179,41 @@ CloneProduct=استنساخ المنتجات أو الخدمات
ConfirmCloneProduct=هل أنت متأكد من أن المنتج أو الخدمة استنساخ <b>٪ ق؟</b>
CloneContentProduct=استنساخ جميع المعلومات الرئيسية من المنتجات / الخدمات
ClonePricesProduct=استنساخ الرئيسية معلومات والأسعار
CloneCompositionProduct=Clone packaged product/services
CloneCompositionProduct=Clone packaged product/service
ProductIsUsed=ويستخدم هذا المنتج
NewRefForClone=المرجع. من المنتجات الجديدة / خدمة
CustomerPrices=أسعار العملاء
SuppliersPrices=أسعار الموردين
SuppliersPricesOfProductsOrServices=Suppliers prices (of products or services)
CustomerPrices=Customer prices
SuppliersPrices=Supplier prices
SuppliersPricesOfProductsOrServices=Supplier prices (of products or services)
CustomCode=قانون الجمارك
CountryOrigin=بلد المنشأ
HiddenIntoCombo=مخبأة في قوائم مختارة
Nature=طبيعة
ShortLabel=Short label
Unit=Unit
p=u.
set=set
se=set
second=second
s=s
hour=hour
h=h
day=day
d=d
kilogram=kilogram
kg=Kg
gram=gram
g=g
meter=meter
m=m
linear meter=linear meter
lm=lm
square meter=square meter
m2=m²
cubic meter=cubic meter
m3=m³
liter=liter
l=L
ProductCodeModel=Product ref template
ServiceCodeModel=Service ref template
AddThisProductCard=Create product card
@ -214,7 +239,7 @@ CostPmpHT=Net total VWAP
ProductUsedForBuild=Auto consumed by production
ProductBuilded=Production completed
ProductsMultiPrice=Product multi-price
ProductsOrServiceMultiPrice=Customers prices (of products or services, multi-prices)
ProductsOrServiceMultiPrice=Customer prices (of products or services, multi-prices)
ProductSellByQuarterHT=Products turnover quarterly VWAP
ServiceSellByQuarterHT=Services turnover quarterly VWAP
Quarter1=1st. Quarter
@ -237,10 +262,10 @@ ResetBarcodeForAllRecords=Define barcode value for all records (this will also r
PriceByCustomer=Different price for each customer
PriceCatalogue=Unique price per product/service
PricingRule=Rules for customer prices
AddCustomerPrice=Add price by customers
AddCustomerPrice=Add price by customer
ForceUpdateChildPriceSoc=Set same price on customer subsidiaries
PriceByCustomerLog=Price by customer log
MinimumPriceLimit=Minimum price can't be lower that %s
MinimumPriceLimit=Minimum price can't be lower then %s
MinimumRecommendedPrice=Minimum recommended price is : %s
PriceExpressionEditor=Price expression editor
PriceExpressionSelected=Selected price expression
@ -267,3 +292,5 @@ GlobalVariableUpdaterHelpFormat1=format is {"URL": "http://example.com/urlofws",
UpdateInterval=Update interval (minutes)
LastUpdated=Last updated
CorrectlyUpdated=Correctly updated
PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is
PropalMergePdfProductChooseFile=Select PDF files

View File

@ -11,7 +11,7 @@ ProjectsPublicDesc=هذا الرأي يعرض جميع المشاريع ويسم
ProjectsPublicTaskDesc=This view presents all projects and tasks you are allowed to read.
ProjectsDesc=ويعرض هذا الرأي جميع المشاريع (أذونات المستخدم الخاص أعطى الصلاحية لعرض كل شيء).
MyTasksDesc=ويقتصر هذا الرأي على المشروعات أو المهام التي هي الاتصال للحصول على (ما هو نوع).
OnlyOpenedProject=Only opened projects are visible (projects with draft or closed status are not visible).
OnlyOpenedProject=Only open projects are visible (projects in draft or closed status are not visible).
TasksPublicDesc=هذا الرأي يعرض جميع المشاريع والمهام ويسمح لك قراءة.
TasksDesc=هذا الرأي يعرض جميع المشاريع والمهام (أذونات المستخدم الخاص أعطى الصلاحية لعرض كل شيء).
AllTaskVisibleButEditIfYouAreAssigned=All tasks for such project are visible, but you can enter time only for task you are assigned on.
@ -29,7 +29,7 @@ ProjectsList=قائمة المشاريع
ShowProject=وتبين للمشروع
SetProject=وضع المشروع
NoProject=لا يعرف أو المملوكة للمشروع
NbOpenTasks=ملاحظة : من مهام فتح
NbOpenTasks=Nb of open tasks
NbOfProjects=ملاحظة : للمشاريع
TimeSpent=الوقت الذي تستغرقه
TimeSpentByYou=Time spent by you
@ -41,7 +41,7 @@ TaskTimeSpent=Time spent on tasks
TaskTimeUser=User
TaskTimeNote=Note
TaskTimeDate=Date
TasksOnOpenedProject=Tasks on opened projects
TasksOnOpenedProject=Tasks on open projects
WorkloadNotDefined=Workload not defined
NewTimeSpent=جديد الوقت الذي يقضيه
MyTimeSpent=وقتي قضى
@ -75,6 +75,7 @@ ListFichinterAssociatedProject=قائمة التدخلات المرتبطة با
ListExpenseReportsAssociatedProject=List of expense reports associated with the project
ListDonationsAssociatedProject=List of donations associated with the project
ListActionsAssociatedProject=قائمة الإجراءات المرتبطة بالمشروع
ListTaskTimeUserProject=List of time consumed on tasks of project
ActivityOnProjectThisWeek=نشاط المشروع هذا الاسبوع
ActivityOnProjectThisMonth=نشاط المشروع هذا الشهر
ActivityOnProjectThisYear=نشاط المشروع هذا العام
@ -95,7 +96,7 @@ DeleteATimeSpent=قضى الوقت حذف
ConfirmDeleteATimeSpent=هل أنت متأكد أنك تريد حذف هذا الوقت الذي يقضيه؟
DoNotShowMyTasksOnly=انظر أيضا المهام الغير موكلة الي
ShowMyTasksOnly=عرض فقط المهام الموكلة الي
TaskRessourceLinks=ملتقيات
TaskRessourceLinks=Resources
ProjectsDedicatedToThisThirdParty=مشاريع مخصصة لهذا الطرف الثالث
NoTasks=أية مهام لهذا المشروع
LinkedToAnotherCompany=ربط طرف ثالث آخر
@ -139,8 +140,12 @@ ProjectReferers=Refering objects
SearchAProject=Search a project
ProjectMustBeValidatedFirst=Project must be validated first
ProjectDraft=Draft projects
FirstAddRessourceToAllocateTime=Associate a ressource to allocate time
FirstAddRessourceToAllocateTime=Associate a resource to allocate time
InputPerDay=Input per day
InputPerWeek=Input per week
InputPerAction=Input per action
TimeAlreadyRecorded=Time spent already recorded for this task/day and user %s
ProjectsWithThisUserAsContact=Projects with this user as contact
TasksWithThisUserAsContact=Tasks assigned to this user
ResourceNotAssignedToProject=Not assigned to project
ResourceNotAssignedToTask=Not assigned to task

View File

@ -4,7 +4,7 @@ Proposal=اقتراح التجارية
ProposalShort=اقتراح
ProposalsDraft=مقترحات مشاريع تجارية
ProposalDraft=اقتراح لمشروع تجاري
ProposalsOpened=افتتح مقترحات تجارية
ProposalsOpened=Open commercial proposals
Prop=مقترحات تجارية
CommercialProposal=اقتراح التجارية
CommercialProposals=مقترحات تجارية
@ -16,7 +16,7 @@ Prospect=احتمال
ProspectList=احتمال قائمة
DeleteProp=اقتراح حذف التجارية
ValidateProp=مصادقة على اقتراح التجارية
AddProp=إضافة اقتراح
AddProp=Create proposal
ConfirmDeleteProp=هل أنت متأكد من أنك تريد حذف هذا التجارية الاقتراح؟
ConfirmValidateProp=هل أنت متأكد من هذا التجارية للمصادقة على الاقتراح؟
LastPropals=آخر مقترحات ٪
@ -31,7 +31,7 @@ AmountOfProposalsByMonthHT=المبلغ في الشهر (بعد خصم الضر
NbOfProposals=عدد من المقترحات والتجاري
ShowPropal=وتظهر اقتراح
PropalsDraft=المسودات
PropalsOpened=فتح
PropalsOpened=Open
PropalsNotBilled=مغلقة لا توصف
PropalStatusDraft=مشروع (لا بد من التحقق من صحة)
PropalStatusValidated=صادق (اقتراح فتح)
@ -42,7 +42,7 @@ PropalStatusNotSigned=لم يتم التوقيع (مغلقة)
PropalStatusBilled=فواتير
PropalStatusDraftShort=مسودة
PropalStatusValidatedShort=صادق
PropalStatusOpenedShort=فتح
PropalStatusOpenedShort=Open
PropalStatusClosedShort=مغلقة
PropalStatusSignedShort=وقعت
PropalStatusNotSignedShort=لم يتم التوقيع
@ -51,12 +51,10 @@ PropalsToClose=مقترحات ليقفل التجارية
PropalsToBill=ووقع على مشروع القانون التجاري مقترحات
ListOfProposals=قائمة مقترحات تجارية
ActionsOnPropal=الإجراءات على الاقتراح
NoOpenedPropals=فتحت أي مقترحات تجارية
NoOtherOpenedPropals=أي اقتراحات أخرى افتتح التجارية
NoOpenedPropals=No open commercial proposals
NoOtherOpenedPropals=No other open commercial proposals
RefProposal=اقتراح المرجع التجارية
SendPropalByMail=اقتراح ارسال التجارية عن طريق البريد
FileNotUploaded=الملف ليس تحميل
FileUploaded=الملف بنجاح تحميلها
AssociatedDocuments=الوثائق المرتبطة الاقتراح :
ErrorCantOpenDir=لا نستطيع فتح الدليل
DatePropal=تاريخ الاقتراح
@ -70,8 +68,8 @@ ErrorPropalNotFound=Propal ق لم يتم العثور على ٪
Estimate=التقدير :
EstimateShort=التقدير
OtherPropals=مقترحات أخرى
# AddToDraftProposals=Add to draft proposal
# NoDraftProposals=No draft proposals
AddToDraftProposals=Add to draft proposal
NoDraftProposals=No draft proposals
CopyPropalFrom=اقتراح إنشاء التجارية عن طريق نسخ وجود اقتراح
CreateEmptyPropal=خلق خاليا التجارية vierge مقترحات أو من قائمة المنتجات / الخدمات
DefaultProposalDurationValidity=تقصير مدة صلاحية اقتراح التجارية (أيام)
@ -97,6 +95,7 @@ TypeContact_propal_external_CUSTOMER=اتصل العملاء اقتراح متا
# Document models
DocModelAzurDescription=اقتراح نموذج كامل (logo...)
DocModelJauneDescription=اقتراح نموذج اليد الصفراء
# DefaultModelPropalCreate=Default model creation
# DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced)
# DefaultModelPropalClosed=Default template when closing a business proposal (unbilled)
DefaultModelPropalCreate=Default model creation
DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced)
DefaultModelPropalClosed=Default template when closing a business proposal (unbilled)
ProposalCustomerSignature=Written acceptance, company stamp, date and signature

View File

@ -11,3 +11,5 @@ ShowSalaryPayment=Show salary payment
THM=Average hourly price
TJM=Average daily price
CurrentSalary=Current salary
THMDescription=This value may be used to calculate cost of time consumed on a project entered by users if module project is used
TJMDescription=This value is currently as information only and is not used for any calculation

Some files were not shown because too many files have changed in this diff Show More