Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop

This commit is contained in:
Maxime Kohlhaas 2015-06-23 20:03:46 +02:00
commit 5e9c85c789
49 changed files with 1028 additions and 638 deletions

View File

@ -74,6 +74,7 @@ if (($id > 0 || ! empty($ref)) && $action != 'add')
// Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('skeleton'));
$extrafields = new ExtraFields($db);
@ -230,8 +231,18 @@ if ($action == 'list' || empty($id))
$sql.= " t.rowid,";
$sql.= " t.field1,";
$sql.= " t.field2";
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
$sql.= " WHERE field3 = 'xxx'";
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " ORDER BY field1 ASC";
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
@ -241,7 +252,8 @@ if ($action == 'list' || empty($id))
print '<div class="liste_titre">';
print $moreforfilter;
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
@ -252,7 +264,8 @@ if ($action == 'list' || empty($id))
print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>'."\n";
// Fields title search
@ -264,7 +277,8 @@ if ($action == 'list' || empty($id))
print '<input type="text" class="flat" name="search_field2" value="'.$search_field2.'" size="10">';
print '</td>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>'."\n";
@ -287,8 +301,9 @@ if ($action == 'list' || empty($id))
print $obj->field2;
print '</td>';
$parameters=array('obj' => $obj);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print '</tr>';
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>';
}
$i++;
}
@ -302,7 +317,8 @@ if ($action == 'list' || empty($id))
$db->free($resql);
$parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>\n";
print "</form>\n";

View File

@ -976,7 +976,6 @@ else
$head = member_prepare_head($object);
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
if ($conf->use_javascript_ajax)
{
@ -1020,6 +1019,8 @@ else
print '<input type="hidden" name="statut" value="'.$object->statut.'" />';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
print '<table class="border" width="100%">';
// Ref
@ -1179,7 +1180,9 @@ else
print '</table>';
print '<br><div class="center">';
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
@ -1187,7 +1190,6 @@ else
print '</form>';
print '</div>';
}
if ($rowid && $action != 'edit')
@ -1277,7 +1279,7 @@ else
$texttosend=$object->makeSubstitution($adht->getMailOnValid());
$tmp=$langs->trans("SendAnEMailToMember");
$tmp.=' ('.$langs->trans("MailFrom").': <b>'.$conf->global->ADHERENT_MAIL_FROM.'</b>, ';
$tmp.='<br>('.$langs->trans("MailFrom").': <b>'.$conf->global->ADHERENT_MAIL_FROM.'</b>, ';
$tmp.=$langs->trans("MailRecipient").': <b>'.$object->email.'</b>)';
$helpcontent='';
$helpcontent.='<b>'.$langs->trans("MailFrom").'</b>: '.$conf->global->ADHERENT_MAIL_FROM.'<br>'."\n";
@ -1298,7 +1300,7 @@ else
if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) {
$formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>'');
}
print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1);
print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1,1);
}
// Confirm send card by mail
@ -1319,7 +1321,7 @@ else
$texttosend=$object->makeSubstitution($adht->getMailOnResiliate());
$tmp=$langs->trans("SendAnEMailToMember");
$tmp.=' ('.$langs->trans("MailFrom").': <b>'.$conf->global->ADHERENT_MAIL_FROM.'</b>, ';
$tmp.='<br>('.$langs->trans("MailFrom").': <b>'.$conf->global->ADHERENT_MAIL_FROM.'</b>, ';
$tmp.=$langs->trans("MailRecipient").': <b>'.$object->email.'</b>)';
$helpcontent='';
$helpcontent.='<b>'.$langs->trans("MailFrom").'</b>: '.$conf->global->ADHERENT_MAIL_FROM.'<br>'."\n";
@ -1335,7 +1337,7 @@ else
$formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion);
print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion,'no',1);
}
// Confirm remove member

View File

@ -73,6 +73,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$sall="";
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('memberlist'));
$extrafields = new ExtraFields($db);
/*
* View
@ -91,6 +95,12 @@ $sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company,
$sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation";
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; // We need this table joined to the select in order to filter by categ
$sql.= ", ".MAIN_DB_PREFIX."adherent_type as t";
@ -100,52 +110,23 @@ if ($catid == -2) $sql.= " AND cm.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cm.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL";
$sql.= " AND d.entity IN (".getEntity('adherent', 1).")";
if ($sall)
{
// For natural search
$scrit = explode(' ', $sall);
foreach ($scrit as $crit)
{
$sql.=" AND (";
if (is_numeric($sall)) $sql.= "d.rowid = ".$db->escape($sall)." OR ";
$sql.=" d.firstname LIKE '%".$db->escape($sall)."%' OR d.lastname LIKE '%".$db->escape($sall)."%' OR d.societe LIKE '%".$db->escape($sall)."%'";
$sql.=" OR d.email LIKE '%".$db->escape($sall)."%' OR d.login LIKE '%".$db->escape($sall)."%' OR d.address LIKE '%".$db->escape($sall)."%'";
$sql.=" OR d.town LIKE '%".$db->escape($sall)."%' OR d.note_public LIKE '%".$db->escape($sall)."%' OR d.note_private LIKE '%".$db->escape($sall)."%')";
}
}
if ($type > 0)
{
$sql.=" AND t.rowid=".$db->escape($type);
}
if (isset($_GET["statut"]) || isset($_POST["statut"]))
{
$sql.=" AND d.statut in (".$db->escape($statut).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
}
if ($sall) $sql.=natural_search(array("d.rowid", "d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
if ($type > 0) $sql.=" AND t.rowid=".$db->escape($type);
if (isset($_GET["statut"]) || isset($_POST["statut"])) $sql.=" AND d.statut in (".$db->escape($statut).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
if ($search_ref)
{
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
else $sql.=" AND 1 = 2"; // Always wrong
}
if ($search_lastname)
{
$sql.= " AND (d.firstname LIKE '%".$db->escape($search_lastname)."%' OR d.lastname LIKE '%".$db->escape($search_lastname)."%' OR d.societe LIKE '%".$db->escape($search_lastname)."%')";
}
if ($search_login)
{
$sql.= " AND d.login LIKE '%".$db->escape($search_login)."%'";
}
if ($search_email)
{
$sql.= " AND (d.email LIKE '%".$db->escape($search_email)."%')";
}
if ($filter == 'uptodate')
{
$sql.=" AND datefin >= '".$db->idate($now)."'";
}
if ($filter == 'outofdate')
{
$sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')";
}
if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
if ($search_login) $sql.= natural_search("d.login", $search_login);
if ($search_email) $sql.= natural_search("d.email", $search_email);
if ($filter == 'uptodate') $sql.=" AND datefin >= '".$db->idate($now)."'";
if ($filter == 'outofdate') $sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')";
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
// Count total nb of records with no order and no limits
$nbtotalofrecords = 0;
@ -199,11 +180,12 @@ if ($resql)
if ($sall)
{
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ";
print '<strong>'.$sall.'</strong>';
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
print "<table class=\"noborder\" width=\"100%\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
// Filter on categories
$moreforfilter='';
@ -214,14 +196,17 @@ if ($resql)
$moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
if ($moreforfilter)
if (! empty($moreforfilter))
{
print '<tr class="liste_titre">';
print '<td class="liste_titre" colspan="9">';
print '<div class="liste_titre">';
print $moreforfilter;
print '</td></tr>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
@ -229,7 +214,12 @@ if ($resql)
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"t.libelle",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
print "</tr>\n";
@ -256,7 +246,12 @@ if ($resql)
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_email" value="'.$search_email.'" size="12"></td>';
print '<td class="liste_titre">&nbsp;</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Status
print '<td class="liste_titre">&nbsp;</td>';
print '<td align="right" colspan="2" class="liste_titre">';
print '<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")).'">';
@ -316,7 +311,11 @@ if ($resql)
// EMail
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
// Statut
$parameters=array('obj' => $obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Statut
print '<td class="nowrap">';
print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print "</td>";
@ -365,6 +364,12 @@ if ($resql)
$i++;
}
$db->free($resql);
$parameters=array('sql' => $sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>\n";
print '</form>';

View File

@ -146,6 +146,10 @@ if ($action == 'setModuleOptions')
else if ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF))
{
dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value,'chaine',0,'',$conf->entity);
}
}
else if ($action == 'del')

View File

@ -45,10 +45,10 @@ $action = GETPOST('action');
if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
// List of supported permanent search area
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT");
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT);
$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"),$langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')',$langs->trans("Members"));
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name');
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT");
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT);
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"));
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
if ($action == 'update')
@ -73,6 +73,7 @@ if ($action == 'update')
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);
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -211,7 +211,7 @@ if ($conf->societe->enabled)
{
$nbno=$nbtotal=0;
print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','');
print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','object_company');
print '<br>'."\n";
$sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
$resql=$db->query($sql);
@ -236,7 +236,7 @@ if ($conf->societe->enabled)
print '<br><input class="button" type="submit" id="submitformbarcodethirdpartygen" '.((GETPOST("selectorforbarcode") && GETPOST("selectorforbarcode"))?'':'disabled ').'value="'.$langs->trans("InitEmptyBarCode",$nbno).'"';
print ' title="'.dol_escape_htmltag($langs->trans("FeatureNotYetAvailable")).'" disabled';
print '>';
print '<br><br><br>';
print '<br><br><br><br>';
}
@ -252,7 +252,7 @@ if ($conf->product->enabled || $conf->product->service)
$nbno=$nbtotal=0;
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','');
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','object_product');
print '<br>'."\n";
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
@ -312,7 +312,7 @@ if ($conf->product->enabled || $conf->product->service)
$moretags2=(($nbno == $nbtotal)?' disabled':'');
print ' &nbsp; ';
print '<input class="button" type="submit" name="eraseallbarcode" id="eraseallbarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretags2.' onClick="return confirm_erase();">';
print '<br><br><br>';
print '<br><br><br><br>';
}

View File

@ -160,7 +160,7 @@ foreach($fulltree as $key => $val)
}
print '<table class="liste" width="100%">';
print '<table class="liste nohover" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Categories").'</td><td></td><td align="right">';
if (! empty($conf->use_javascript_ajax))
{

View File

@ -66,6 +66,7 @@ if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id;
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('customerlist'));
$extrafields = new ExtraFields($db);
/*
@ -107,6 +108,12 @@ llxHeader('',$langs->trans("ThirdParty"),$help_url);
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
$sql.= " s.datec, s.canvas";
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
@ -116,33 +123,22 @@ $sql.= " AND s.client IN (1, 3)";
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_company) {
$sql .= natural_search(
array(
's.nom',
's.name_alias'
),
$search_company
);
}
if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
if ($search_town) {
$sql .= natural_search('s.town', $search_town);
}
if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'";
if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'";
if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status);
// Insert sale filter
if ($search_sale > 0)
{
$sql .= " AND sc.fk_user = ".$search_sale;
}
if ($search_company) $sql.= natural_search(array('s.nom', 's.name_alias'), $search_company);
if ($search_zipcode) $sql.= natural_search("s.zip", $search_zipcode);
if ($search_town) $sql.= natural_search('s.town', $search_town);
if ($search_code) $sql.= natural_search("s.code_client", $search_code);
if ($search_compta) $sql.= natural_search("s.code_compta", $search_compta);
if ($search_status!='') $sql.= " AND s.status = ".$db->escape($search_status);
if ($search_sale > 0) $sql.= " AND sc.fk_user = ".$search_sale;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
// Count total nb of records
$nbtotalofrecords = 0;
@ -190,6 +186,9 @@ if ($result)
{
print '<div class="liste_titre">';
print $moreforfilter;
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
@ -202,11 +201,12 @@ if ($result)
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
print "</tr>\n";
print '<tr class="liste_titre">';
@ -234,6 +234,10 @@ if ($result)
print '&nbsp;';
print '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<td class="liste_titre" align="center">';
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
print '</td>';
@ -242,9 +246,6 @@ if ($result)
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print '</tr>'."\n";
@ -272,12 +273,15 @@ if ($result)
print '<td>'.$obj->code_client.'</td>';
print '<td>'.$obj->code_compta.'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
print '<td align="center">'.$thirdpartystatic->getLibStatut(3);
print '</td>';
print '<td></td>';
$parameters=array('obj' => $obj);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<td align="center">'.$thirdpartystatic->getLibStatut(3);
print '</td>';
print '<td></td>';
print "</tr>\n";
$i++;
@ -285,7 +289,8 @@ if ($result)
$db->free($result);
$parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>\n";
print "</form>\n";

View File

@ -156,6 +156,7 @@ $sts = array(-1,0,1,2,3);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('prospectlist'));
$extrafields = new ExtraFields($db);
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
@ -214,6 +215,12 @@ $sql.= " s.prefix_comm, s.fk_prospectlevel, s.fk_stcomm as stcomm_id,";
$sql.= " st.libelle as stcomm_label,";
$sql.= " d.nom as departement";
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)";
@ -229,15 +236,7 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_nom) {
$sql .= natural_search(
array(
's.nom',
's.name_alias'
),
$search_nom
);
}
if ($search_nom) $sql .= natural_search(array('s.nom','s.name_alias'), $search_nom);
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'";
if ($search_town) $sql .= natural_search('s.town', $search_town);
if ($search_state) $sql .= natural_search('d.nom', $search_state);
@ -253,6 +252,10 @@ if ($socname)
$sortfield = "s.nom";
$sortorder = "ASC";
}
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
// Count total nb of records
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -326,6 +329,9 @@ if ($resql)
{
print '<div class="liste_titre">';
print $moreforfilter;
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
@ -340,11 +346,13 @@ if ($resql)
print_liste_field_titre($langs->trans("ProspectLevelShort"),$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print "</tr>\n";
@ -404,6 +412,10 @@ if ($resql)
print '&nbsp;';
print '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<td class="liste_titre" align="center">';
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
print '</td>';
@ -413,10 +425,6 @@ if ($resql)
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n";
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</tr>\n";
$i = 0;
@ -462,13 +470,15 @@ if ($resql)
}
print '</td>';
print '<td align="center">';
$parameters=array('obj' => $obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<td align="center">';
print $prospectstatic->LibStatut($prospectstatic->status,3);
print '</td>';
print '<td></td>';
$parameters=array('obj' => $obj);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print '<td></td>';
print "</tr>\n";
$i++;
@ -483,7 +493,8 @@ if ($resql)
$db->free($resql);
$parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
}
else
{

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
*
@ -98,7 +98,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
// Statistics
print '<table class="noborder" width="100%">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="4">'.$langs->trans("Statistics").'</td>';
print "</tr>\n";
@ -111,7 +111,7 @@ foreach ($listoftype as $code => $label)
if ($conf->use_javascript_ajax)
{
print '<tr><td align="center" colspan="4">';
print '<tr '.$bc[false].'><td align="center" colspan="4">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1);
print '</td></tr>';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
@ -1149,6 +1149,14 @@ else
else print $langs->trans("NoDolibarrAccess");
print '</td></tr>';
print '<tr><td>';
print $langs->trans("ExportCardToFormat").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$contact->id.'">';
print img_picto($langs->trans("VCard"),'vcard.png').' ';
print $langs->trans("VCard");
print '</a>';
print '</td></tr>';
print "</table>";
print dol_fiche_end();

View File

@ -1,112 +0,0 @@
<?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-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
* 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/contact/exportimport.php
* \ingroup societe
* \brief Onglet exports-imports d'un contact
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
$langs->load("companies");
// Security check
$id = GETPOST('id', 'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
/*
* View
*/
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
$form = new Form($db);
$contact = new Contact($db);
$contact->fetch($id, $user);
$head = contact_prepare_head($contact);
dol_fiche_head($head, 'exportimport', $title, 0, 'contact');
/*
* Fiche en mode visu
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($contact, 'id', $linkback);
print '</td></tr>';
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
if ($contact->socid > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($contact->socid);
print '<tr><td width="15%">'.$langs->trans("ThirdParty").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr><td width="15%">'.$langs->trans("ThirdParty").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
}
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $contact->getCivilityLabel();
print '</td></tr>';
print '</table>';
print '</div>';
print '<br>';
print $langs->trans("ExportCardToFormat").': ';
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$contact->id.'">';
print img_picto($langs->trans("VCard"),'vcard.png').' ';
print $langs->trans("VCard");
print '</a>';
$db->close();
llxFooter();

View File

@ -273,7 +273,6 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$tdparam='';
if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td'];
if (empty($contents[$i][$j]['text'])) $contents[$i][$j]['text']="";
$text=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:'';
$textwithnotags=preg_replace('/<([^>]+)>/i','',$text);
$text2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:'';

View File

@ -404,7 +404,7 @@ class Form
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
$s="";
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr style="height: auto;">';
elseif ($notabs == 2) $s.='<div class="inline-block nowrap">';
elseif ($notabs == 2) $s.='<div class="inline-block">';
// Define value if value is before
if ($direction < 0) {
$s.='<'.$tag.$paramfortooltipimg;
@ -3212,9 +3212,9 @@ class Form
// Show JQuery confirm box. Note that global var $useglobalvars is used inside this template
$formconfirm.= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
if (! empty($more)) {
$formconfirm.= '<div>'.$more.'</div>';
$formconfirm.= '<div class="confirmquestions">'.$more.'</div>';
}
$formconfirm.= ($question ? img_help('','').' '.$question : '');
$formconfirm.= ($question ? '<div class="confirmmessage"'.img_help('','').' '.$question . '</div>': '');
$formconfirm.= '</div>'."\n";
$formconfirm.= "\n<!-- begin ajax form_confirm page=".$page." -->\n";
@ -4608,7 +4608,7 @@ class Form
*
* @param int $id Id of object
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated.
* @param int $rendermode 0=Default, use multiselect. 1=Use text with link
* @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect
* @return mixed Array of category objects or < 0 if KO
*/
function showCategories($id, $type, $rendermode=0)
@ -4626,10 +4626,10 @@ class Form
$ways = $c->print_all_ways();
foreach($ways as $way)
{
$toprint[] = img_object('','category').' '.$way;
$toprint[] = '<li class="select2-search-choice-dolibarr">'.img_object('','category').' '.$way.'</li>';
}
}
return implode('<br>', $toprint);
return '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
}
if ($rendermode == 0)

View File

@ -57,11 +57,6 @@ function contact_prepare_head(Contact $object)
$head[$tab][2] = 'perso';
$tab++;
$head[$tab][0] = DOL_URL_ROOT.'/contact/exportimport.php?id='.$object->id;
$head[$tab][1] = $langs->trans("ExportImport");
$head[$tab][2] = 'exportimport';
$tab++;
// 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

@ -5037,10 +5037,10 @@ function dol_getmypid()
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
* If param $mode is 2, can contains a list of id separated by comma like "1,3,4"
* @param integer $mode 0=value is list of keywords, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
* @param integer $nofinaland 1=Do now output the final 'AND'
* @param integer $nofirstand 1=Do now output the first 'AND'
* @return string $res The statement to append to the SQL query
*/
function natural_search($fields, $value, $mode=0, $nofinaland=0)
function natural_search($fields, $value, $mode=0, $nofirstand=0)
{
global $db,$langs;
@ -5107,7 +5107,7 @@ function natural_search($fields, $value, $mode=0, $nofinaland=0)
if ($newres) $res = $res . ($res ? ' AND ' : '') . ($i2 > 1 ? '(' : '') .$newres . ($i2 > 1 ? ')' : '');
$j++;
}
$res = ($nofinaland?"":" AND ")."(" . $res . ")";
$res = ($nofirstand?"":" AND ")."(" . $res . ")";
//print 'xx'.$res.'yy';
return $res;
}

View File

@ -53,7 +53,7 @@ function project_prepare_head($object)
|| ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled))
{
$head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id;
$head[$h][1] = $langs->trans("ProjectReferers");
$head[$h][1] = $langs->trans("Overview");
$head[$h][2] = 'element';
$h++;
}

View File

@ -1133,6 +1133,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
/*
* Menu SUPPLIERS
*/
/*
if ($mainmenu == 'suppliers')
{
$langs->load("suppliers");
@ -1173,6 +1174,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
}
}
*/
/*
* Menu PROJECTS

View File

@ -361,7 +361,7 @@ class pdf_standard extends ModeleExpenseReport
// Total with all taxes
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($this->postotalttc-2, $curY);
$pdf->SetXY($this->postotalttc-1, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalttc, 3, price($object->lines[$i]->total_ttc), 0, 'R');
$nexY+=5;

View File

@ -70,7 +70,7 @@ $searchform = '';
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
{
$langs->load("companies");
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
$nbofsearch++;
}

View File

@ -594,7 +594,9 @@ else
print "</td></tr>";
print '<tr><td>';
print $langs->trans('CronDtNextLaunch')."</td><td>";
print $langs->trans('CronDtNextLaunch');
print ' ('.$langs->trans('CronFrom').')';
print "</td><td>";
if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');}
print "</td></tr>";

View File

@ -842,8 +842,8 @@ class Cronjob extends CommonObject
/**
* Run a job
*
* @param string $userlogin User login
* @return int <0 if KO, >0 if OK
* @param string $userlogin User login
* @return int <0 if KO, >0 if OK
*/
function run_jobs($userlogin)
{

View File

@ -49,6 +49,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST('date_debutmonth'), GETPOST('date_debu
$date_end = dol_mktime(0, 0, 0, GETPOST('date_finmonth'), GETPOST('date_finday'), GETPOST('date_finyear'));
$date = dol_mktime(0, 0, 0, GETPOST('datemonth'), GETPOST('dateday'), GETPOST('dateyear'));
$fk_projet=GETPOST('fk_projet');
$vatrate=GETPOST('vatrate');
$ref=GETPOST("ref",'alpha');
// If socid provided by ajax company selector
@ -178,7 +179,7 @@ if ($action == 'update' && $user->rights->expensereport->creer)
}
}
if ($action == "confirm_save" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer)
if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer)
{
$object = new ExpenseReport($db);
$object->fetch($id);
@ -220,6 +221,8 @@ if ($action == "confirm_save" && GETPOST("confirm") == "yes" && $id > 0 && $user
if ($emailTo && $emailFrom)
{
$filename=array(); $filedir=array(); $mimetype=array();
// SUBJECT
$subject = $langs->trans("ExpenseReportWaitingForApproval");
@ -234,7 +237,6 @@ if ($action == "confirm_save" && GETPOST("confirm") == "yes" && $id > 0 && $user
if($resultPDF):
// ATTACHMENT
$filename=array(); $filedir=array(); $mimetype=array();
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
array_push($filedir,$conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref) . "/" . dol_sanitizeFileName($object->ref).".pdf");
array_push($mimetype,"application/pdf");
@ -260,7 +262,7 @@ if ($action == "confirm_save" && GETPOST("confirm") == "yes" && $id > 0 && $user
if ($mailfile->error)
{
$mesg='';
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$mesg.=$langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
$mesg.='<br>'.$mailfile->error;
setEventMessage($mesg,'errors');
}
@ -859,7 +861,8 @@ if ($action == "addline")
$object_ligne->fk_c_type_fees = GETPOST('fk_c_type_fees');
$object_ligne->vatrate = price2num(GETPOST('vatrate'));
$object_ligne->fk_c_tva = GETPOST('fk_c_tva');
$object_ligne->vatrate = price2num($vatrate);
$object_ligne->fk_projet = $fk_projet;
@ -904,10 +907,10 @@ if ($action == "addline")
{
$object_ligne->fk_expensereport = $_POST['fk_expensereport'];
$type = 0; // TODO What if service
$type = 0; // TODO What if service ?
$tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type);
$object_ligne->vatrate = price2num(GETPOST('vatrate'));
$object_ligne->vatrate = price2num($vatrate);
$object_ligne->total_ttc = $tmp[2];
$object_ligne->total_ht = $tmp[0];
$object_ligne->total_tva = $tmp[1];
@ -1350,7 +1353,7 @@ else
dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip');
if ($action == 'save'):
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save","","",1);
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1);
if ($ret == 'html') print '<br>';
endif;
@ -1399,7 +1402,7 @@ else
if ($ret == 'html') print '<br>';
}
print '<table class="border" width="100%">';
print '<table class="border centpercent">';
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
@ -1426,6 +1429,7 @@ else
print '<td>'.$langs->trans("Statut").'</td>';
print '<td colspan="2">'.$object->getLibStatut(4).'</td>';
print '</tr>';
print '<tr>';
print '<td>'.$langs->trans("NotePublic").'</td>';
print '<td colspan="2">'.$object->note_public.'</td>';
@ -1529,20 +1533,6 @@ else
print '<td>'.$langs->trans("DATE_SAVE").'</td>';
print '<td>'.dol_print_date($object->date_create,'dayhour').'</td></tr>';
print '</tr>';
if($object->fk_statut==6)
{
print '<tr>';
print '<td>'.$langs->trans("AUTHORPAIEMENT").'</td>';
print '<td>';
$userfee=new User($db);
$userfee->fetch($object->fk_user_paid);
print $userfee->getNomUrl(1);
print '</td></tr>';
print '<tr>';
print '<td>'.$langs->trans("DATE_PAIEMENT").'</td>';
print '<td>'.$object->date_paiement.'</td></tr>';
print '</tr>';
}
// User to inform
if($object->fk_statut<3) // informed
@ -1614,6 +1604,22 @@ else
print '</td>';
print '</tr>';
}
if($object->fk_statut==6)
{
print '<tr>';
print '<td>'.$langs->trans("AUTHORPAIEMENT").'</td>';
print '<td>';
$userfee=new User($db);
$userfee->fetch($object->fk_user_paid);
print $userfee->getNomUrl(1);
print '</td></tr>';
print '<tr>';
print '<td>'.$langs->trans("DATE_PAIEMENT").'</td>';
print '<td>'.$object->date_paiement.'</td></tr>';
print '</tr>';
}
print '</table>';
print '<br>';

View File

@ -112,7 +112,7 @@ class ExpenseReport extends CommonObject
// List of language codes for status
$this->statuts_short = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused');
$this->statuts = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused');
$this->statuts = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused');
$this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut8');
return 1;

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
*
@ -70,13 +70,11 @@ $totalnb=$totalsum=0;
$sql = "SELECT tf.code, tf.label, count(de.rowid) as nb, sum(de.total_ht) as km";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."expensereport_det as de, ".MAIN_DB_PREFIX."c_type_fees as tf";
$sql.= " WHERE de.fk_expensereport = d.rowid AND de.fk_c_type_fees = tf.id";
// RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous))
{
$sql.= " AND d.fk_user_author IN (".join(',',$childids).")\n";
}
$sql.= " GROUP BY tf.code, tf.label";
$result = $db->query($sql);
@ -202,7 +200,7 @@ if ($result)
}
else
{
print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
}

View File

@ -105,7 +105,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.f
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$result=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef ON ef.fk_object = s.rowid";
@ -121,19 +121,9 @@ if ($socname) {
$sortfield = "s.nom";
$sortorder = "ASC";
}
if ($search_name) {
$sql .= natural_search(
array(
's.nom',
's.name_alias'
),
$search_name
);
}
if ($search_name) $sql .= natural_search(array('s.nom', 's.name_alias'), $search_name);
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
if ($search_town) {
$sql .= natural_search('s.town', $search_town);
}
if ($search_town) $sql .= natural_search('s.town', $search_town);
if ($search_supplier_code) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_supplier_code)."%'";
if ($search_supplier_accounting) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_supplier_accounting)."%'";
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
@ -143,8 +133,9 @@ if ($search_categ > 0) $sql.= " AND cf.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cf.fk_categorie IS NULL";
// Add where from hooks
$parameters=array();
$result=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
// Count total nb of records
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -166,7 +157,7 @@ if ($resql)
$param = "&amp;search_name=".$search_name."&amp;search_supplier_code=".$search_supplier_code."&amp;search_zipcode=".$search_zipcode."&amp;search_town=".$search_town;
if ($search_categ != '') $param.='&amp;search_categ='.$search_categ;
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies');
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
@ -183,6 +174,9 @@ if ($resql)
{
print '<div class="liste_titre">';
print $moreforfilter;
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
@ -229,7 +223,7 @@ if ($resql)
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n";
print "</td>\n";
print '</tr>';

View File

@ -501,7 +501,7 @@ Module600Name=Notifications
Module600Desc=Send EMail notifications on some Dolibarr business events to third-party contacts (setup defined on each thirdparty)
Module700Name=Donations
Module700Desc=Donation management
Module770Name=Expense Report
Module770Name=Expense reports
Module770Desc=Management and claim expense reports (transportation, meal, ...)
Module1120Name=Supplier commercial proposal
Module1120Desc=Request supplier commercial proposal and prices

View File

@ -76,6 +76,7 @@ CronMethodHelp=The object method to launch. <BR> For exemple to fetch method of
CronArgsHelp=The method arguments. <BR> For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be <i>0, ProductRef</i>
CronCommandHelp=The system command line to execute.
CronCreateJob=Create new Scheduled Job
CronFrom=From
# Info
CronInfoPage=Information
# Common

View File

@ -191,3 +191,4 @@ WarningNotRelevant=Irrelevant operation for this dataset
WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Feature disabled when display setup is optimized for blind person or text browsers.
WarningPaymentDateLowerThanInvoiceDate=Payment date (%s) is earlier than invoice date (%s) for invoice %s.
WarningTooManyDataPleaseUseMoreFilters=Too many data. Please use more filters
WarningSomeLinesWithNullHourlyRate=Some times were recorded by users when their hourly rate was not defined. A value of 0 was used but this may result in wrong valuation of time spent.

View File

@ -302,7 +302,7 @@ UnitPriceTTC=Unit price
PriceU=U.P.
PriceUHT=U.P. (net)
AskPriceSupplierUHT=U.P. net Requested
PriceUTTC=U.P.
PriceUTTC=U.P. (inc. tax)
Amount=Amount
AmountInvoice=Invoice amount
AmountPayment=Payment amount

View File

@ -199,7 +199,8 @@ Entreprises=Companies
DOLIBARRFOUNDATION_PAYMENT_FORM=To make your subscription payment using a bank transfer, see page <a target="_blank" href="http://wiki.dolibarr.org/index.php/Subscribe#To_subscribe_making_a_bank_transfer">http://wiki.dolibarr.org/index.php/Subscribe</a>.<br>To pay using a Credit Card or Paypal, click on button at bottom of this page.<br>
ByProperties=By characteristics
MembersStatisticsByProperties=Members statistics by characteristics
MembersByNature=Members by nature
MembersByNature=This screen show you statistics on members by nature.
MembersByRegion=This screen show you statistics on members by region.
VATToUseForSubscriptions=VAT rate to use for subscriptions
NoVatOnSubscription=No TVA for subscriptions
MEMBER_PAYONLINE_SENDEMAIL=Email to warn when Dolibarr receive a confirmation of a validated payment for subscription

View File

@ -77,6 +77,7 @@ ListExpenseReportsAssociatedProject=List of expense reports associated with the
ListDonationsAssociatedProject=List of donations associated with the project
ListActionsAssociatedProject=List of events associated with the project
ListTaskTimeUserProject=List of time consumed on tasks of project
TaskTimeUserProject=Time consumed on tasks of project
ActivityOnProjectThisWeek=Activity on project this week
ActivityOnProjectThisMonth=Activity on project this month
ActivityOnProjectThisYear=Activity on project this year
@ -151,4 +152,5 @@ TasksWithThisUserAsContact=Tasks assigned to this user
ResourceNotAssignedToProject=Not assigned to project
ResourceNotAssignedToTask=Not assigned to task
AssignTaskToMe=Assign task to me
AssignTask=Assign
AssignTask=Assign
ProjectOverview=Overview

View File

@ -76,6 +76,7 @@ BROUILLONNER=Reopen
SendToValid=Sent on approval
ModifyInfoGen=Edit
ValidateAndSubmit=Validate and submit for approval
ValidatedWaitingApproval=Validated (waiting for approval)
NOT_VALIDATOR=You are not allowed to approve this expense report
NOT_AUTHOR=You are not the author of this expense report. Operation cancelled.

View File

@ -1526,7 +1526,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
{
$langs->load("companies");
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', $langs->trans("ThirdParties"), 'soc', 'socname', 'T', 'searchleftt', img_object('','company'));
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'socname', 'T', 'searchleftt', img_object('','company'));
}
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
@ -1555,6 +1555,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
}
if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire)
{
$langs->load("members");
$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'M', 'searchleftproj', img_object('','projectpub'));
}
// Execute hook printSearchForm
$parameters=array();
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks

View File

@ -930,7 +930,7 @@ class Task extends CommonObject
$result=array();
$sql = "SELECT";
$sql.= " SUM(t.task_duration / 3600 * thm) as amount";
$sql.= " SUM(t.task_duration / 3600 * ".$this->db->ifsql("t.thm IS NULL", 0, "t.thm").") as amount, SUM(".$this->db->ifsql("t.thm IS NULL", 1, 0).") as nblinesnull";
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
$sql.= " WHERE t.fk_task = ".$id;
if (is_object($fuser) && $fuser->id > 0)
@ -947,7 +947,8 @@ class Task extends CommonObject
$datefieldname="task_datehour";
$sql.=" AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)";
}
//print $sql;
dol_syslog(get_class($this)."::getSumOfAmount", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
@ -955,7 +956,8 @@ class Task extends CommonObject
$obj = $this->db->fetch_object($resql);
$result['amount'] = $obj->amount;
$result['nblinesnull'] = $obj->nblinesnull;
$this->db->free($resql);
return $result;
}

View File

@ -293,7 +293,187 @@ if ($action=="addelement")
$elementuser = new User($db);
$showdatefilter=0;
// Show the filter on date on top of element list
if (! $showdatefilter)
{
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
print '<input type="hidden" name="action" value="view">';
print '<table><tr>';
print '<td>'.$langs->trans("From").' ';
print $form->select_date($dates,'dates',0,0,1);
print '</td>';
print '<td>'.$langs->trans("to").' ';
print $form->select_date($datee,'datee',0,0,1);
print '</td>';
print '<td>';
print '<input type="submit" name="refresh" value="'.$langs->trans("Refresh").'" class="button">';
print '</td>';
print '</tr></table>';
print '</form>';
$showdatefilter++;
}
// Show balance for whole project
$langs->load("suppliers");
$langs->load("bills");
$langs->load("orders");
$langs->load("proposals");
$langs->load("margins");
//print load_fiche_titre($langs->trans("Profit"),'','title_accountancy');
print '<div class="center">'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'</div><br>';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td align="left" width="200">'.$langs->trans("Element").'</td>';
print '<td align="right" width="100">'.$langs->trans("Number").'</td>';
print '<td align="right" width="100">'.$langs->trans("AmountHT").'</td>';
print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>';
print '</tr>';
$var = false;
foreach ($listofreferent as $key => $value)
{
$name=$langs->trans($value['name']);
$title=$value['title'];
$classname=$value['class'];
$tablename=$value['table'];
$datefieldname=$value['datefieldname'];
$qualified=$value['test'];
$margin = $value['margin'];
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus')
{
$element = new $classname($db);
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
if (count($elementarray)>0 && is_array($elementarray))
{
$total_ht = 0;
$total_ttc = 0;
$num=count($elementarray);
for ($i = 0; $i < $num; $i++)
{
$tmp=explode('_',$elementarray[$i]);
$idofelement=$tmp[0];
$idofelementuser=$tmp[1];
$element->fetch($idofelement);
if ($idofelementuser) $elementuser->fetch($idofelementuser);
if ($tablename != 'expensereport_det') $element->fetch_thirdparty();
if ($tablename == 'don') $total_ht_by_line=$element->amount;
elseif ($tablename == 'projet_task')
{
if ($idofelementuser)
{
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee);
$total_ht_by_line = price2num($tmp['amount'],'MT');
}
else
{
$tmp = $element->getSumOfAmount('', $dates, $datee);
$total_ht_by_line = price2num($tmp['amount'],'MT');
}
}
else $total_ht_by_line=$element->total_ht;
$total_ht = $total_ht + $total_ht_by_line;
if ($tablename == 'don') $total_ttc_by_line=$element->amount;
elseif ($tablename == 'projet_task')
{
$defaultvat = get_default_tva($mysoc, $mysoc);
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)),'MT');
}
else $total_ttc_by_line=$element->total_ttc;
$total_ttc = $total_ttc + $total_ttc_by_line;
}
// Calculate margin
if ($margin=="add")
{
$balance_ht+= $total_ht;
$balance_ttc+= $total_ttc;
}
else
{
$balance_ht-= $total_ht;
$balance_ttc-= $total_ttc;
}
// Show $total_ht & $total_ttc -- add a minus when necessary
if ($margin!="add")
{
$total_ht = -$total_ht;
$total_ttc = -$total_ttc;
}
switch ($classname) {
case 'FactureFournisseur':
$newclassname = 'SupplierInvoice';
break;
case 'Facture':
$newclassname = 'Bill';
break;
case 'Propal':
$newclassname = 'CommercialProposal';
break;
case 'Commande':
$newclassname = 'Order';
break;
case 'Expedition':
$newclassname = 'Sending';
break;
case 'Contrat':
$newclassname = 'Contract';
break;
default:
$newclassname = $classname;
}
$var = ! $var;
print '<tr '.$bc[$var].'>';
// Module
print '<td align="left">'.$langs->trans($newclassname).'</td>';
// Nb
print '<td align="right">'.$i.'</td>';
// Amount HT
print '<td align="right">'.price($total_ht).'</td>';
// Amount TTC
print '<td align="right">'.price($total_ttc).'</td>';
print '</tr>';
}
}
}
// and the final balance
print '<tr class="liste_total">';
print '<td align="right" colspan=2 >'.$langs->trans("Total").'</td>';
print '<td align="right" >'.price($balance_ht).'</td>';
print '<td align="right" >'.price($balance_ttc).'</td>';
print '</tr>';
print "</table>";
print '<br><br>';
print '<br>';
// Detail
foreach ($listofreferent as $key => $value)
{
$title=$value['title'];
@ -310,32 +490,7 @@ foreach ($listofreferent as $key => $value)
$element = new $classname($db);
// Show the filter on date on top of element list
if (! $showdatefilter)
{
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
print '<input type="hidden" name="action" value="view">';
print '<table><tr>';
print '<td>'.$langs->trans("From").' ';
print $form->select_date($dates,'dates',0,0,1);
print '</td>';
print '<td>'.$langs->trans("to").' ';
print $form->select_date($datee,'datee',0,0,1);
print '</td>';
print '<td>';
print '<input type="submit" name="refresh" value="'.$langs->trans("Refresh").'" class="button">';
print '</td>';
print '</tr></table>';
print '</form><br>';
$showdatefilter++;
}
print '<br>';
print_titre($langs->trans($title));
$addform='';
$selectList=$formproject->select_element($tablename,$object->thirdparty->id);
if (! $selectList || ($selectList<0))
{
@ -343,17 +498,20 @@ foreach ($listofreferent as $key => $value)
}
elseif($selectList)
{
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
print '<input type="hidden" name="action" value="addelement">';
print '<input type="hidden" name="datesrfc" value="'.dol_print_date($dates,'dayhourrfc').'">';
print '<input type="hidden" name="dateerfc" value="'.dol_print_date($datee,'dayhourrfc').'">';
print '<table><tr><td>'.$langs->trans("SelectElement").'</td>';
print '<td>'.$selectList.'</td>';
print '<td><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("AddElement")).'"></td>';
print '</tr></table>';
print '</form>';
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
$addform.='<input type="hidden" name="action" value="addelement">';
$addform.='<input type="hidden" name="datesrfc" value="'.dol_print_date($dates,'dayhourrfc').'">';
$addform.='<input type="hidden" name="dateerfc" value="'.dol_print_date($datee,'dayhourrfc').'">';
$addform.='<table><tr><td>'.$langs->trans("SelectElement").'</td>';
$addform.='<td>'.$selectList.'</td>';
$addform.='<td><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("AddElement")).'"></td>';
$addform.='</tr></table>';
$addform.='</form>';
}
print_fiche_titre($langs->trans($title), $addform, '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -463,7 +621,11 @@ foreach ($listofreferent as $key => $value)
}
else
{
if ($element instanceof Task) print $element->getNomUrl(1,'withproject','time');
if ($element instanceof Task)
{
print $element->getNomUrl(1,'withproject','time');
print ' - '.dol_trunc($element->label, 48);
}
else print $element->getNomUrl(1);
$element_doc = $element->element;
@ -522,13 +684,19 @@ foreach ($listofreferent as $key => $value)
print '</td>';
// Amount without tax
$warning='';
if (empty($value['disableamount']))
{
if ($tablename == 'don') $total_ht_by_line=$element->amount;
elseif ($tablename == 'projet_task')
{
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee);
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty
$total_ht_by_line = price2num($tmp['amount'],'MT');
if ($tmp['nblinesnull'] > 0)
{
$langs->load("errors");
$warning=$langs->trans("WarningSomeLinesWithNullHourlyRate");
}
}
else
{
@ -538,6 +706,7 @@ foreach ($listofreferent as $key => $value)
if (! $qualifiedfortotal) print '<strike>';
print (isset($total_ht_by_line)?price($total_ht_by_line):'&nbsp;');
if (! $qualifiedfortotal) print '</strike>';
if ($warning) print ' '.img_warning($warning);
print '</td>';
}
else print '<td></td>';
@ -559,13 +728,18 @@ foreach ($listofreferent as $key => $value)
if (! $qualifiedfortotal) print '<strike>';
print (isset($total_ttc_by_line)?price($total_ttc_by_line):'&nbsp;');
if (! $qualifiedfortotal) print '</strike>';
if ($warning) print ' '.img_warning($warning);
print '</td>';
}
else print '<td></td>';
// Status
print '<td align="right">';
if ($element instanceof CommonInvoice)
if ($tablename == 'expensereport_det')
{
print $expensereport->getLibStatut(5);
}
else if ($element instanceof CommonInvoice)
{
//This applies for Facture and FactureFournisseur
print $element->getLibStatut(5, $element->getSommePaiement());
@ -633,192 +807,10 @@ foreach ($listofreferent as $key => $value)
print $elementarray;
}
print "</table>";
/*
* Barre d'action
*/
print '<div class="tabsAction">';
if ($object->statut > 0)
{
if ($object->thirdparty->prospect || $object->thirdparty->client)
{
if ($key == 'propal' && ! empty($conf->propal->enabled) && $user->rights->propale->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->thirdparty->id.'&amp;action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'">'.$langs->trans("AddProp").'</a>';
}
if ($key == 'order' && ! empty($conf->commande->enabled) && $user->rights->commande->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->thirdparty->id.'&amp;action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'">'.$langs->trans("AddCustomerOrder").'</a>';
}
if ($key == 'invoice' && ! empty($conf->facture->enabled) && $user->rights->facture->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?socid='.$object->thirdparty->id.'&amp;action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'">'.$langs->trans("AddCustomerInvoice").'</a>';
}
}
if ($object->thirdparty->fournisseur)
{
if ($key == 'order_supplier' && ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?socid='.$project->thirdparty->id.'&amp;action=create&amp;origin='.$project->element.'&amp;originid='.$project->id.'">'.$langs->trans("AddSupplierOrder").'</a>';
}
if ($key == 'invoice_supplier' && ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?socid='.$project->thirdparty->id.'&amp;action=create&amp;origin='.$project->element.'&amp;originid='.$project->id.'">'.$langs->trans("AddSupplierInvoice").'</a>';
}
}
}
print '</div>';
}
}
// Show profit summary for whole project
$langs->load("suppliers");
$langs->load("bills");
$langs->load("orders");
$langs->load("proposals");
$langs->load("margins");
//print load_fiche_titre($langs->trans("Profit"),'','title_accountancy');
print '<br><div class="center">'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'</div><br>';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td align="left" width="200">'.$langs->trans("Element").'</td>';
print '<td align="right" width="100">'.$langs->trans("Number").'</td>';
print '<td align="right" width="100">'.$langs->trans("AmountHT").'</td>';
print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>';
print '</tr>';
foreach ($listofreferent as $key => $value)
{
$name=$langs->trans($value['name']);
$title=$value['title'];
$classname=$value['class'];
$tablename=$value['table'];
$datefieldname=$value['datefieldname'];
$qualified=$value['test'];
$margin = $value['margin'];
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus')
{
$element = new $classname($db);
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
if (count($elementarray)>0 && is_array($elementarray))
{
$var=true;
$total_ht = 0;
$total_ttc = 0;
$num=count($elementarray);
for ($i = 0; $i < $num; $i++)
{
$tmp=explode('_',$elementarray[$i]);
$idofelement=$tmp[0];
$idofelementuser=$tmp[1];
$element->fetch($idofelement);
if ($idofelementuser) $elementuser->fetch($idofelementuser);
if ($tablename != 'expensereport_det') $element->fetch_thirdparty();
if ($tablename == 'don') $total_ht_by_line=$element->amount;
elseif ($tablename == 'projet_task')
{
if ($idofelementuser)
{
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee);
$total_ht_by_line = price2num($tmp['amount'],'MT');
}
else
{
$tmp = $element->getSumOfAmount('', $dates, $datee);
$total_ht_by_line = price2num($tmp['amount'],'MT');
}
}
else $total_ht_by_line=$element->total_ht;
$total_ht = $total_ht + $total_ht_by_line;
if ($tablename == 'don') $total_ttc_by_line=$element->amount;
elseif ($tablename == 'projet_task')
{
$defaultvat = get_default_tva($mysoc, $mysoc);
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)),'MT');
}
else $total_ttc_by_line=$element->total_ttc;
$total_ttc = $total_ttc + $total_ttc_by_line;
}
// Calculate margin
if ($margin=="add")
{
$margin_ht+= $total_ht;
$margin_ttc+= $total_ttc;
}
else
{
$margin_ht-= $total_ht;
$margin_ttc-= $total_ttc;
}
// Show $total_ht & $total_ttc -- add a minus when necessary
if ($margin!="add")
{
$total_ht = -$total_ht;
$total_ttc = -$total_ttc;
}
switch ($classname) {
case 'FactureFournisseur':
$newclassname = 'SupplierInvoice';
break;
case 'Facture':
$newclassname = 'Bill';
break;
case 'Propal':
$newclassname = 'CommercialProposal';
break;
case 'Commande':
$newclassname = 'Order';
break;
case 'Expedition':
$newclassname = 'Sending';
break;
case 'Contrat':
$newclassname = 'Contract';
break;
default:
$newclassname = $classname;
}
print '<tr>';
// Module
print '<td align="left">'.$langs->trans($newclassname).'</td>';
// Nb
print '<td align="right">'.$i.'</td>';
// Amount HT
print '<td align="right">'.price($total_ht).'</td>';
// Amount TTC
print '<td align="right">'.price($total_ttc).'</td>';
print '</tr>';
}
}
}
// and the margin amount total
print '<tr class="liste_total">';
print '<td align="right" colspan=2 >'.$langs->trans("Total").'</td>';
print '<td align="right" >'.price($margin_ht).'</td>';
print '<td align="right" >'.price($margin_ttc).'</td>';
print '</tr>';
print "</table>";
llxFooter();

View File

@ -61,6 +61,7 @@ $pagenext = $page + 1;
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
$search_all=GETPOST("search_all");
$search_ref=GETPOST("search_ref");
$search_label=GETPOST("search_label");
$search_societe=GETPOST("search_societe");
@ -83,11 +84,11 @@ if ($search_status == '') $search_status=-1; // -1 or 1
// Purge criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search_all='';
$search_ref="";
$search_label="";
$search_societe="";
$search_year="";
$search_all=0;
$search_status=-1;
$search_public="";
$search_sale="";
@ -102,7 +103,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('projectlist'));
$extrafields = new ExtraFields($db);
@ -123,6 +124,12 @@ $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$min
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_statut, p.public, p.fk_user_creat";
$sql.= ", p.datec as date_create, p.dateo as date_start, p.datee as date_end";
$sql.= ", s.nom as name, s.rowid as socid";
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
@ -139,18 +146,9 @@ if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$pro
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
//if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
if ($search_ref)
{
$sql .= natural_search('p.ref', $search_ref);
}
if ($search_label)
{
$sql .= natural_search('p.title', $search_label);
}
if ($search_societe)
{
$sql .= natural_search('s.nom', $search_societe);
}
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
if ($search_label) $sql .= natural_search('p.title', $search_label);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($smonth > 0)
{
if ($syear > 0 && empty($sday))
@ -177,18 +175,15 @@ else if ($year > 0)
{
$sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
if ($search_all)
{
$sql .= natural_search(array('p.ref','p.title','s.nom'), $search_all);
}
if ($search_all) $sql .= natural_search(array('p.ref','p.title','s.nom'), $search_all);
if ($search_status >= 0) $sql .= " AND p.fk_statut = ".$db->escape($search_status);
if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0)
{
$sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user;
}
if ($search_user > 0) $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset);
@ -205,6 +200,7 @@ if ($resql)
$param='';
if ($month) $param.='&month='.$month;
if ($year) $param.='&year=' .$year;
if ($search_all != '') $param.='&search_all='.$search_all;
if ($search_ref != '') $param.='&search_ref='.$search_ref;
if ($search_label != '') $param.='&search_label='.$search_label;
if ($search_societe != '') $param.='&search_societe='.$search_societe;
@ -228,6 +224,12 @@ if ($resql)
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
}
if ($search_all)
{
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Label")." ".$langs->trans("or")." ".$langs->trans("ThirdParty")."): ";
print '<strong>'.$search_all.'</strong>';
}
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
{
@ -248,8 +250,9 @@ if ($resql)
print '<div class="liste_titre">';
print $moreforfilter;
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print '</div>';
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
@ -263,10 +266,13 @@ if ($resql)
if (! empty($conf->global->PROJECT_LIST_SHOW_STARTDATE)) print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"p.dateo","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"p.datee","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
print '<tr class="liste_titre">';
@ -302,15 +308,18 @@ if ($resql)
print $form->selectarray('search_public',$array,$search_public);
print '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<td class="liste_titre nowrap" align="right">';
print $form->selectarray('search_status', array('-1'=>'', '0'=>$langs->trans('Draft'),'1'=>$langs->trans('Opened'),'2'=>$langs->trans('Closed')),$search_status);
print '</td><td width="56">';
print '</td>';
print '<td width="56">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print '</tr>'."\n";
@ -405,13 +414,14 @@ if ($resql)
else print $langs->trans('PrivateProject');
print '</td>';
$parameters=array('obj' => $objp);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Status
$projectstatic->statut = $objp->fk_statut;
print '<td align="right" colspan="2">'.$projectstatic->getLibStatut(5).'</td>';
$parameters=array('obj' => $objp);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
}
@ -422,7 +432,8 @@ if ($resql)
$db->free($resql);
$parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>\n";
print "</form>\n";

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
* Copyright (C) 2013 Florian Henry <forian.henry@open-cocnept.pro>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -149,7 +149,7 @@ if (is_array($object->lines) && (count($object->lines)>0))
}
// Execut job
$result=$cronjob->run_jobs($userlogin);
if ($result<0)
if ($result < 0)
{
echo "Error:".$cronjob->error;
dol_syslog("cron_run_jobs.php:: run_jobs Error".$cronjob->error, LOG_ERR);

View File

@ -307,7 +307,7 @@ abstract class ActionsCardCommon
if ($result >= 0)
{
header("Location: ".DOL_URL_ROOT."/societe/societe.php?delsoc=".$this->object->name."");
header("Location: ".DOL_URL_ROOT."/societe/list.php?delsoc=".$this->object->name."");
exit;
}
else

View File

@ -61,7 +61,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
*/
$rowspan=2;
if (! empty($conf->barcode->enabled)) $rowspan++;
print '<form method="post" action="'.DOL_URL_ROOT.'/societe/societe.php">';
print '<form method="post" action="'.DOL_URL_ROOT.'/societe/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">'."\n";
print '<tr class="liste_titre">';

View File

@ -20,7 +20,7 @@
*/
/**
* \file htdocs/societe/societe.php
* \file htdocs/societe/list.php
* \ingroup societe
* \brief Page to show list of third parties
*/
@ -66,6 +66,10 @@ $offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('thirdpartylist'));
$extrafields = new ExtraFields($db);
/*
* Actions
@ -181,7 +185,6 @@ if ($socname)
*/
/*
REM: Regle sur droits "Voir tous les clients"
REM: Exemple, voir la page societe.php dans le mode liste.
Utilisateur interne socid=0 + Droits voir tous clients => Voit toute societe
Utilisateur interne socid=0 + Pas de droits voir tous clients => Ne voit que les societes liees comme commercial
Utilisateur externe socid=x + Droits voir tous clients => Ne voit que lui meme
@ -196,6 +199,12 @@ $sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idpr
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
// We'll need these fields in order to filter by categ
if ($search_categ) $sql .= ", cs.fk_categorie, cs.fk_soc";
// Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
$sql.= " ".MAIN_DB_PREFIX."c_stcomm as st";
// We'll need this table joined to the select in order to filter by sale
@ -205,57 +214,31 @@ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE s.fk_stcomm = st.id";
$sql.= " AND s.entity IN (".getEntity('societe', 1).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
if ($search_categ) $sql.= " AND s.rowid = cs.fk_soc"; // Join for the needed table to filter by categ
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
if ($search_categ) $sql.= " AND s.rowid = cs.fk_soc"; // Join for the needed table to filter by categ
if (! $user->rights->fournisseur->lire) $sql.=" AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
// Insert sale filter
if ($search_sale)
{
$sql .= " AND sc.fk_user = ".$db->escape($search_sale);
}
// Insert categ filter
if ($search_categ)
{
$sql .= " AND cs.fk_categorie = ".$db->escape($search_categ);
}
if ($search_nom_only)
{
$sql.= " AND s.nom LIKE '%".$db->escape($search_nom_only)."%'";
}
if ($search_all)
{
$sql.= " AND (";
$sql.= "s.nom LIKE '%".$db->escape($search_all)."%'";
$sql.= " OR s.code_client LIKE '%".$db->escape($search_all)."%'";
$sql.= " OR s.email LIKE '%".$db->escape($search_all)."%'";
$sql.= " OR s.url LIKE '%".$db->escape($search_all)."%'";
$sql.= " OR s.siren LIKE '%".$db->escape($search_all)."%'";
$sql.= ")";
}
if ($search_nom)
{
$sql.= " AND (";
$sql.= "s.nom LIKE '%".$db->escape($search_nom)."%'";
$sql.= " OR s.code_client LIKE '%".$db->escape($search_nom)."%'";
$sql.= " OR s.email LIKE '%".$db->escape($search_nom)."%'";
$sql.= " OR s.url LIKE '%".$db->escape($search_nom)."%'";
$sql.= " OR s.siren LIKE '%".$db->escape($search_nom)."%'";
$sql.= ")";
}
if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape($search_town)."%'";
if ($search_idprof1) $sql .= " AND s.siren LIKE '%".$db->escape($search_idprof1)."%'";
if ($search_idprof2) $sql .= " AND s.siret LIKE '%".$db->escape($search_idprof2)."%'";
if ($search_idprof3) $sql .= " AND s.ape LIKE '%".$db->escape($search_idprof3)."%'";
if ($search_idprof4) $sql .= " AND s.idprof4 LIKE '%".$db->escape($search_idprof4)."%'";
if ($search_idprof5) $sql .= " AND s.idprof5 LIKE '%".$db->escape($search_idprof5)."%'";
if ($search_idprof6) $sql .= " AND s.idprof6 LIKE '%".$db->escape($search_idprof6)."%'";
if ($search_sale) $sql .= " AND sc.fk_user = ".$db->escape($search_sale);
if ($search_categ) $sql .= " AND cs.fk_categorie = ".$db->escape($search_categ);
if ($search_nom_only) $sql.= natural_search("s.nom",$search_nom_only);
if ($search_all) $sql.= natural_search(array("s.nom", "s.name_alias", "s.code_client", "s.code_fournisseur", "s.email", "s.url","s.siren","s.siret","s.ape","s.idprof4","s.idprof5","s.idprof6"), $search_all);
if ($search_nom) $sql.= natural_search(array("s.nom", "s.name_alias", "s.code_client", "s.code_fournisseur", "s.email", "s.url","s.siren","s.siret","s.ape","s.idprof4","s.idprof5","s.idprof6"), $search_nom);
if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape($search_town)."%'";
if ($search_idprof1) $sql .= " AND s.siren LIKE '%".$db->escape($search_idprof1)."%'";
if ($search_idprof2) $sql .= " AND s.siret LIKE '%".$db->escape($search_idprof2)."%'";
if ($search_idprof3) $sql .= " AND s.ape LIKE '%".$db->escape($search_idprof3)."%'";
if ($search_idprof4) $sql .= " AND s.idprof4 LIKE '%".$db->escape($search_idprof4)."%'";
if ($search_idprof5) $sql .= " AND s.idprof5 LIKE '%".$db->escape($search_idprof5)."%'";
if ($search_idprof6) $sql .= " AND s.idprof6 LIKE '%".$db->escape($search_idprof6)."%'";
// Filter on type of thirdparty
if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")";
if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1";
if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
if (!empty($conf->barcode->enabled) && $sbarcode) $sql.= " AND s.barcode LIKE '%".$db->escape($sbarcode)."%'";
//print $sql;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
// Count total nb of records
$nbtotalofrecords = 0;
@ -281,7 +264,7 @@ if ($resql)
$params.= '&amp;search_idprof3='.htmlspecialchars($search_idprof3);
$params.= '&amp;search_idprof4='.htmlspecialchars($search_idprof4);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies');
// Show delete result message
if (GETPOST('delsoc'))
@ -305,8 +288,6 @@ if ($resql)
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="liste" width="100%">';
// Filter on categories
/* Not possible in this page because list is for ALL third parties type
$moreforfilter='';
@ -330,6 +311,17 @@ if ($resql)
print '</td></tr>';
}
*/
if (! empty($moreforfilter))
{
print '<div class="liste_titre">';
print $moreforfilter;
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
print '<table class="liste" width="100%">';
// Lines of titles
print '<tr class="liste_titre">';
@ -341,10 +333,13 @@ if ($resql)
print_liste_field_titre($form->textwithpicto($langs->trans("ProfId3Short"),$textprofid[3],1,0),$_SERVER["PHP_SELF"],"s.ape","",$params,'class="nowrap"',$sortfield,$sortorder);
print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$params,'class="nowrap"',$sortfield,$sortorder);
print_liste_field_titre('');
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$params,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre
// Fields title search
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
@ -389,7 +384,12 @@ if ($resql)
print '<option value="4"'.($search_type=='4'?' selected':'').'>'.$langs->trans('Supplier').'</option>';
print '<option value="0"'.($search_type=='0'?' selected':'').'>'.$langs->trans('Others').'</option>';
print '</select></td>';
// Status
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Status
print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '&nbsp; ';
@ -446,6 +446,12 @@ if ($resql)
}
print $s;
print '</td>';
$parameters=array('obj' => $obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Status
print '<td align="right">'.$companystatic->getLibStatut(3).'</td>';
print '</tr>'."\n";
@ -454,6 +460,10 @@ if ($resql)
$db->free($resql);
$parameters=array('sql' => $sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</table>";
print '</form>';

View File

@ -643,7 +643,7 @@ if (empty($reshook))
if ($result > 0)
{
header("Location: ".DOL_URL_ROOT."/societe/societe.php?delsoc=".urlencode($object->name));
header("Location: ".DOL_URL_ROOT."/societe/list.php?delsoc=".urlencode($object->name));
exit;
}
else
@ -2204,7 +2204,7 @@ else
print '</td></tr>';
}
// Categories
// Tags / categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';

View File

@ -147,7 +147,7 @@ background: #DDDFDD;
}
table { font-size: 12px; }
table.login { border: 1px solid #C0C0C0; background: #F0F0F0; font-size: 12px; }
table.login { border: 1px solid #C0C0C0; background: #FFF; font-size: 12px; }
.inline-block
{

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
*
@ -194,7 +194,8 @@ print '</td></tr></table>';
print '</td>';
print '</tr><tr>';
$urlwiki='http://wiki.dolibarr.org/index.php/List of Dolibarr partners and providers';
#$urlwiki='http://wiki.dolibarr.org/index.php/List of Dolibarr partners and providers';
$urlwiki='http://partners.dolibarr.org';
print '<td align="center" valign="top">';
print '<table class="nocellnopadd">';
print '<tr><td align="center">';
@ -228,7 +229,8 @@ print '</td></tr></table>';
print '</td>';
print '</tr><tr>';
$urlwiki='http://wiki.dolibarr.org/index.php/List of Dolibarr partners and providers';
#$urlwiki='http://wiki.dolibarr.org/index.php/List of Dolibarr partners and providers';
$urlwiki='http://partners.dolibarr.org';
print '<td align="center" valign="top">';
print '<table class="nocellnopadd">';
print '<tr><td align="center">';

View File

@ -2266,6 +2266,101 @@ div.jnotify-background {
}
/* ============================================================================== */
/* Select2 */
/* ============================================================================== */
.selectoptiondisabledwhite {
background: #FFFFFF !important;
}
.select2-choice,
.select2-drop.select2-drop-above.select2-drop-active,
.select2-container-active .select2-choice,
.select2-container-active .select2-choices,
.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices,
.select2-container-multi.select2-container-active .select2-choices
{
border: 1px solid #aaa;
}
.select2-disabled
{
color: #888;
}
.select2-drop-active
{
border: 1px solid #aaa;
border-top: none;
}
a span.select2-chosen
{
font-weight: normal !important;
}
.select2-container .select2-choice {
background-image: none;
height: 24px;
line-height: 24px;
}
.select2-choices .select2-search-choice {
border: 1px solid #aaa !important;
}
.select2-results .select2-no-results, .select2-results .select2-searching, .select2-results .select2-ajax-error, .select2-results .select2-selection-limit
{
background: #FFFFFF;
}
.select2-container-multi.select2-container-disabled .select2-choices {
background-color: #FFFFFF;
background-image: none;
border: none;
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice {
margin-bottom: 3px;
}
/* To emulate select 2 style */
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr {
padding: 2px 5px 1px 5px;
margin: 0 0 2px 3px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
}
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr a {
font-weight: normal;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr li {
float: left;
list-style: none;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr {
height: auto !important;
height: 1%;
margin: 0;
padding: 0 5px 0 0;
position: relative;
cursor: text;
overflow: hidden;
}
/* ============================================================================== */
/* JMobile */
/* ============================================================================== */

View File

@ -2440,6 +2440,101 @@ div.ecmjqft {
}
/* ============================================================================== */
/* Select2 */
/* ============================================================================== */
.selectoptiondisabledwhite {
background: #FFFFFF !important;
}
.select2-choice,
.select2-drop.select2-drop-above.select2-drop-active,
.select2-container-active .select2-choice,
.select2-container-active .select2-choices,
.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices,
.select2-container-multi.select2-container-active .select2-choices
{
border: 1px solid #aaa;
}
.select2-disabled
{
color: #888;
}
.select2-drop-active
{
border: 1px solid #aaa;
border-top: none;
}
a span.select2-chosen
{
font-weight: normal !important;
}
.select2-container .select2-choice {
background-image: none;
height: 24px;
line-height: 24px;
}
.select2-choices .select2-search-choice {
border: 1px solid #aaa !important;
}
.select2-results .select2-no-results, .select2-results .select2-searching, .select2-results .select2-ajax-error, .select2-results .select2-selection-limit
{
background: #FFFFFF;
}
.select2-container-multi.select2-container-disabled .select2-choices {
background-color: #FFFFFF;
background-image: none;
border: none;
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice {
margin-bottom: 3px;
}
/* To emulate select 2 style */
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr {
padding: 2px 5px 1px 5px;
margin: 0 0 2px 3px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
}
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr a {
font-weight: normal;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr li {
float: left;
list-style: none;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr {
height: auto !important;
height: 1%;
margin: 0;
padding: 0 5px 0 0;
position: relative;
cursor: text;
overflow: hidden;
}
/* ============================================================================== */
/* JMobile */
/* ============================================================================== */

View File

@ -2625,6 +2625,101 @@ div.ecmjqft {
}
/* ============================================================================== */
/* Select2 */
/* ============================================================================== */
.selectoptiondisabledwhite {
background: #FFFFFF !important;
}
.select2-choice,
.select2-drop.select2-drop-above.select2-drop-active,
.select2-container-active .select2-choice,
.select2-container-active .select2-choices,
.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices,
.select2-container-multi.select2-container-active .select2-choices
{
border: 1px solid #aaa;
}
.select2-disabled
{
color: #888;
}
.select2-drop-active
{
border: 1px solid #aaa;
border-top: none;
}
a span.select2-chosen
{
font-weight: normal !important;
}
.select2-container .select2-choice {
background-image: none;
height: 24px;
line-height: 24px;
}
.select2-choices .select2-search-choice {
border: 1px solid #aaa !important;
}
.select2-results .select2-no-results, .select2-results .select2-searching, .select2-results .select2-ajax-error, .select2-results .select2-selection-limit
{
background: #FFFFFF;
}
.select2-container-multi.select2-container-disabled .select2-choices {
background-color: #FFFFFF;
background-image: none;
border: none;
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice {
margin-bottom: 3px;
}
/* To emulate select 2 style */
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr {
padding: 2px 5px 1px 5px;
margin: 0 0 2px 3px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
}
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr a {
font-weight: normal;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr li {
float: left;
list-style: none;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr {
height: auto !important;
height: 1%;
margin: 0;
padding: 0 5px 0 0;
position: relative;
cursor: text;
overflow: hidden;
}
/* ============================================================================== */
/* JMobile */
/* ============================================================================== */

View File

@ -195,7 +195,7 @@ legend { margin-bottom: 8px; }
}
.buttonRefused {
pointer-events: none;
cursor: default;
cursor: default;
opacity: 0.4;
filter: alpha(opacity=40); /* For IE8 and earlier */
box-shadow: none;
@ -2505,6 +2505,102 @@ div.ecmjqft {
background-image: none;
}
/* ============================================================================== */
/* Select2 */
/* ============================================================================== */
.selectoptiondisabledwhite {
background: #FFFFFF !important;
}
.select2-choice,
.select2-drop.select2-drop-above.select2-drop-active,
.select2-container-active .select2-choice,
.select2-container-active .select2-choices,
.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices,
.select2-container-multi.select2-container-active .select2-choices
{
border: 1px solid #aaa;
}
.select2-disabled
{
color: #888;
}
.select2-drop-active
{
border: 1px solid #aaa;
border-top: none;
}
a span.select2-chosen
{
font-weight: normal !important;
}
.select2-container .select2-choice {
background-image: none;
height: 24px;
line-height: 24px;
}
.select2-choices .select2-search-choice {
border: 1px solid #aaa !important;
}
.select2-results .select2-no-results, .select2-results .select2-searching, .select2-results .select2-ajax-error, .select2-results .select2-selection-limit
{
background: #FFFFFF;
}
.select2-container-multi.select2-container-disabled .select2-choices {
background-color: #FFFFFF;
background-image: none;
border: none;
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice {
margin-bottom: 3px;
}
/* To emulate select 2 style */
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr {
padding: 2px 5px 1px 5px;
margin: 0 0 2px 3px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
}
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr a {
font-weight: normal;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr li {
float: left;
list-style: none;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr {
height: auto !important;
height: 1%;
margin: 0;
padding: 0 5px 0 0;
position: relative;
cursor: text;
overflow: hidden;
}
/* ============================================================================== */
/* JMobile */
/* ============================================================================== */

View File

@ -465,7 +465,9 @@ div.divsearchfield {
float: <?php print $left; ?>;
margin-<?php print $right; ?>: 12px;
}
div.confirmmessage {
padding-top: 6px;
}
/* Style to move picto into left of button */
/*
.buttonactionview {
@ -3392,8 +3394,50 @@ a span.select2-chosen
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice {
margin-bottom: 2px;
margin-bottom: 3px;
}
/* To emulate select 2 style */
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr {
padding: 2px 5px 1px 5px;
margin: 0 0 2px 3px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
}
.select2-container-multi-dolibarr .select2-choices-dolibarr .select2-search-choice-dolibarr a {
font-weight: normal;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr li {
float: left;
list-style: none;
}
.select2-container-multi-dolibarr .select2-choices-dolibarr {
height: auto !important;
height: 1%;
margin: 0;
padding: 0 5px 0 0;
position: relative;
cursor: text;
overflow: hidden;
}
/* ============================================================================== */