Merge remote-tracking branch 'Upstream/develop' into develop-37
This commit is contained in:
commit
fae0a99a97
@ -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";
|
||||
|
||||
@ -106,20 +106,6 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
|
||||
llxHeader('', $langs->trans("CustomersVentilation") . ' - ' . $langs->trans("Dispatched"));
|
||||
|
||||
$page = GETPOST("page");
|
||||
if ($page < 0)
|
||||
$page = 0;
|
||||
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} elseif ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql = "SELECT l.rowid , f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.qty, l.tva_tx, l.fk_code_ventilation, aa.label, aa.account_number,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
@ -170,7 +156,7 @@ if ($result) {
|
||||
print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '"/></div>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Invoices"), $_SERVER["PHP_SELF"],"f.facnumber","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"],"f.facnumber","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
|
||||
@ -181,7 +167,7 @@ if ($result) {
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $search_facture . '"></td>';
|
||||
print '<tr class="liste_titre"><td><input type="text" class="flat" name="search_facture" size="8" value="' . $search_facture . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
|
||||
|
||||
@ -46,6 +46,18 @@ $search_desc = GETPOST('search_desc','alpha');
|
||||
$search_amount = GETPOST('search_amount','alpha');
|
||||
$search_account = GETPOST('search_account','alpha');
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
if (! $sortfield) $sortfield="f.ref";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
@ -95,20 +107,6 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
|
||||
llxHeader('', $langs->trans("SuppliersVentilation") . ' - ' . $langs->trans("Dispatched"));
|
||||
|
||||
$page = GETPOST("page");
|
||||
if ($page < 0)
|
||||
$page = 0;
|
||||
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht , l.qty, l.rowid, l.tva_tx, aa.label, aa.account_number, ";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
@ -138,12 +136,8 @@ if (strlen(trim($search_account))) {
|
||||
if (! empty($conf->multicompany->enabled)) {
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY l.rowid";
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
||||
$sql .= " DESC ";
|
||||
}
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::list sql= ' . $sql1);
|
||||
$result = $db->query($sql);
|
||||
@ -152,7 +146,6 @@ if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list...
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
||||
|
||||
print '<td align="left"><b>' . $langs->trans("DescVentilDoneSupplier") . '</b></td>';
|
||||
@ -160,29 +153,30 @@ if ($result) {
|
||||
print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<br><br><div class="inline-block divButAction">'. $langs->trans("ChangeAccount");
|
||||
print '<br><br><div class="inline-block divButAction">'. $langs->trans("ChangeAccount") . '<br>';
|
||||
print $formventilation->select_account(GETPOST('account_parent'), 'account_parent', 1);
|
||||
print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '" /></div>';
|
||||
|
||||
print '<tr class="liste_titre"><td>' . $langs->trans("Invoice") . '</td>';
|
||||
print '<td>' . $langs->trans("Ref") . '</td>';
|
||||
print '<td>' . $langs->trans("Label") . '</td>';
|
||||
print '<td>' . $langs->trans("Description") . '</td>';
|
||||
print '<td align="left">' . $langs->trans("Amount") . '</td>';
|
||||
print '<td colspan="2" align="left">' . $langs->trans("Account") . '</td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"],"l.total_ht","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"],"aa.account_number","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $search_facture . '"></td>';
|
||||
|
||||
print '<tr class="liste_titre"><td><input type="text" class="flat" name="search_facture" size="8" value="' . $search_facture . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_amount" value="' . $search_amount . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="center"> </td>';
|
||||
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 '<td class="liste_titre" align="center"><input type="text" class="flat" size="8" name="search_amount" value="' . $search_amount . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td class="liste_titre" colspan="2"> </td>';
|
||||
print '<td class="liste_titre" align="center"><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";
|
||||
|
||||
@ -215,8 +209,8 @@ if ($result) {
|
||||
|
||||
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
|
||||
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
|
||||
print '<td align="left">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="left">' . $codeCompta . '</td>';
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="center">' . $codeCompta . '</td>';
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
print '<td><a href="./card.php?id=' . $objp->rowid . '">';
|
||||
print img_edit();
|
||||
|
||||
@ -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 ' ';
|
||||
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
|
||||
|
||||
@ -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.=' ';
|
||||
}
|
||||
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"> </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"> </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>';
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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 ' ';
|
||||
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>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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))
|
||||
{
|
||||
|
||||
@ -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 ' ';
|
||||
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";
|
||||
|
||||
@ -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 ' ';
|
||||
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
|
||||
{
|
||||
|
||||
@ -106,7 +106,7 @@ $h++;
|
||||
dol_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment');
|
||||
*/
|
||||
|
||||
print_barre_liste($langs->trans("NewStandingOrder"), 0, $_SERVER["PHP_SELF"]);
|
||||
print_fiche_titre($langs->trans("NewStandingOrder"));
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
@ -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']:'';
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
|
||||
|
||||
@ -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>";
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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 = "&search_name=".$search_name."&search_supplier_code=".$search_supplier_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||
if ($search_categ != '') $param.='&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>';
|
||||
|
||||
|
||||
@ -51,7 +51,6 @@ $now=dol_now();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Si création de la demande
|
||||
if ($action == 'create')
|
||||
{
|
||||
$cp = new Holiday($db);
|
||||
@ -66,12 +65,15 @@ if ($action == 'create')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
|
||||
$date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
|
||||
$date_debut_gmt = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'), 1);
|
||||
$date_fin_gmt = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'), 1);
|
||||
$starthalfday=GETPOST('starthalfday');
|
||||
$endhalfday=GETPOST('endhalfday');
|
||||
$type=GETPOST('type');
|
||||
$halfday=0;
|
||||
if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2;
|
||||
else if ($starthalfday == 'afternoon') $halfday=-1;
|
||||
@ -131,17 +133,22 @@ if ($action == 'create')
|
||||
$cp->date_fin = $date_fin;
|
||||
$cp->fk_validator = $valideur;
|
||||
$cp->halfday = $halfday;
|
||||
$cp->fk_type = $type;
|
||||
|
||||
$verif = $cp->create($userid);
|
||||
$verif = $cp->create($user);
|
||||
|
||||
// Si pas d'erreur SQL on redirige vers la fiche de la demande
|
||||
if ($verif > 0)
|
||||
{
|
||||
header('Location: card.php?id='.$verif);
|
||||
$db->commit();
|
||||
|
||||
header('Location: card.php?id='.$verif);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$db->rollback();
|
||||
|
||||
// Sinon on affiche le formulaire de demande avec le message d'erreur SQL
|
||||
header('Location: card.php?action=request&error=SQL_Create&msg='.$cp->error);
|
||||
exit;
|
||||
@ -242,44 +249,41 @@ if ($action == 'update')
|
||||
}
|
||||
|
||||
// Si suppression de la demande
|
||||
if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes')
|
||||
if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights->holiday->delete)
|
||||
{
|
||||
if($user->rights->holiday->delete)
|
||||
{
|
||||
$error=0;
|
||||
$error=0;
|
||||
|
||||
$db->begin();
|
||||
$db->begin();
|
||||
|
||||
$cp = new Holiday($db);
|
||||
$cp->fetch($id);
|
||||
$cp = new Holiday($db);
|
||||
$cp->fetch($id);
|
||||
|
||||
$canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all));
|
||||
$canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all));
|
||||
|
||||
// Si c'est bien un brouillon
|
||||
if ($cp->statut == 1 || $cp->statut == 3)
|
||||
{
|
||||
// Si l'utilisateur à le droit de lire cette demande, il peut la supprimer
|
||||
if ($canedit)
|
||||
{
|
||||
$result=$cp->delete($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = $langs->trans('ErrorCantDeleteCP');
|
||||
}
|
||||
}
|
||||
// Si c'est bien un brouillon
|
||||
if ($cp->statut == 1 || $cp->statut == 3)
|
||||
{
|
||||
// Si l'utilisateur à le droit de lire cette demande, il peut la supprimer
|
||||
if ($canedit)
|
||||
{
|
||||
$result=$cp->delete($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = $langs->trans('ErrorCantDeleteCP');
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
// Si envoi de la demande
|
||||
@ -466,7 +470,7 @@ if ($action == 'confirm_valid')
|
||||
|
||||
if ($action == 'confirm_refuse')
|
||||
{
|
||||
if (!empty($_POST['detail_refuse']))
|
||||
if (! empty($_POST['detail_refuse']))
|
||||
{
|
||||
$cp = new Holiday($db);
|
||||
$cp->fetch($_GET['id']);
|
||||
@ -770,6 +774,8 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
// User
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("User").'</td>';
|
||||
print '<td>';
|
||||
@ -781,6 +787,24 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
||||
else print $form->select_users(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Type
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("Type").'</td>';
|
||||
print '<td>';
|
||||
$typeleaves=$cp->getTypes(1,1);
|
||||
$arraytypeleaves=array();
|
||||
foreach($typeleaves as $key => $val)
|
||||
{
|
||||
$labeltoshow = $val['label'];
|
||||
$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':'');
|
||||
$arraytypeleaves[$val['rowid']]=$labeltoshow;
|
||||
}
|
||||
print $form->selectarray('type', $arraytypeleaves, (GETPOST('type')?GETPOST('type'):''), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date start
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("DateDebCP").' ('.$langs->trans("FirstDayOfHoliday").')</td>';
|
||||
print '<td>';
|
||||
@ -795,6 +819,8 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
||||
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday')?GETPOST('starthalfday'):'morning'));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("DateFinCP").' ('.$langs->trans("LastDayOfHoliday").')</td>';
|
||||
print '<td>';
|
||||
@ -952,9 +978,9 @@ else
|
||||
if ($action == 'edit' && $cp->statut == 1)
|
||||
{
|
||||
$edit = true;
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$_GET['id'].'">'."\n";
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'">'."\n";
|
||||
print '<input type="hidden" name="action" value="update"/>'."\n";
|
||||
print '<input type="hidden" name="holiday_id" value="'.$_GET['id'].'" />'."\n";
|
||||
print '<input type="hidden" name="holiday_id" value="'.$id.'" />'."\n";
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
@ -974,6 +1000,15 @@ else
|
||||
print $userRequest->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td>';
|
||||
$typeleaves=$cp->getTypes(1,1);
|
||||
print $typeleaves[$cp->fk_type]['label'];
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$starthalfday=($cp->halfday == -1 || $cp->halfday == 2)?'afternoon':'morning';
|
||||
$endhalfday=($cp->halfday == 1 || $cp->halfday == 2)?'morning':'afternoon';
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ class Holiday extends CommonObject
|
||||
var $date_debut_gmt=''; // Date start in GMT
|
||||
var $date_fin_gmt=''; // Date end in GMT
|
||||
var $halfday='';
|
||||
var $statut=''; // 1=draft, 2=validated, 3=approved
|
||||
var $statut=''; // 1=draft, 2=validated, 3=approved
|
||||
var $fk_validator;
|
||||
var $date_valid='';
|
||||
var $fk_user_valid;
|
||||
@ -62,6 +62,7 @@ class Holiday extends CommonObject
|
||||
var $date_cancel='';
|
||||
var $fk_user_cancel;
|
||||
var $detail_refuse='';
|
||||
var $fk_type;
|
||||
|
||||
var $holiday = array();
|
||||
var $events = array();
|
||||
@ -71,6 +72,7 @@ class Holiday extends CommonObject
|
||||
var $optValue = '';
|
||||
var $optRowid = '';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -124,10 +126,10 @@ class Holiday extends CommonObject
|
||||
$sql.= "date_fin,";
|
||||
$sql.= "halfday,";
|
||||
$sql.= "statut,";
|
||||
$sql.= "fk_validator";
|
||||
$sql.= "fk_validator,";
|
||||
$sql.= "fk_type,";
|
||||
$sql.= "fk_user_create";
|
||||
$sql.= ") VALUES (";
|
||||
|
||||
// User
|
||||
$sql.= "'".$this->fk_user."',";
|
||||
$sql.= " '".$this->db->idate($now)."',";
|
||||
$sql.= " '".$this->db->escape($this->description)."',";
|
||||
@ -135,8 +137,9 @@ class Holiday extends CommonObject
|
||||
$sql.= " '".$this->db->idate($this->date_fin)."',";
|
||||
$sql.= " ".$this->halfday.",";
|
||||
$sql.= " '1',";
|
||||
$sql.= " '".$this->fk_validator."'";
|
||||
|
||||
$sql.= " '".$this->fk_validator."',";
|
||||
$sql.= " '".$this->fk_type."',";
|
||||
$sql.= " ".$user->id;
|
||||
$sql.= ")";
|
||||
|
||||
$this->db->begin();
|
||||
@ -150,7 +153,6 @@ class Holiday extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
$this->rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."holiday");
|
||||
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@ -200,7 +202,9 @@ class Holiday extends CommonObject
|
||||
$sql.= " cp.fk_user_cancel,";
|
||||
$sql.= " cp.detail_refuse,";
|
||||
$sql.= " cp.note_private,";
|
||||
$sql.= " cp.note_public";
|
||||
$sql.= " cp.note_public,";
|
||||
$sql.= " cp.fk_user_create,";
|
||||
$sql.= " cp.fk_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp";
|
||||
$sql.= " WHERE cp.rowid = ".$id;
|
||||
|
||||
@ -213,8 +217,8 @@ class Holiday extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->rowid = $obj->rowid; // deprecated
|
||||
$this->ref = $obj->rowid;
|
||||
$this->rowid = $obj->rowid; // deprecated
|
||||
$this->ref = $obj->rowid;
|
||||
$this->fk_user = $obj->fk_user;
|
||||
$this->date_create = $this->db->jdate($obj->date_create);
|
||||
$this->description = $obj->description;
|
||||
@ -234,6 +238,8 @@ class Holiday extends CommonObject
|
||||
$this->detail_refuse = $obj->detail_refuse;
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->fk_user_create = $obj->fk_user_create;
|
||||
$this->fk_type = $obj->fk_type;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -1841,7 +1847,7 @@ class Holiday extends CommonObject
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($result))
|
||||
{
|
||||
$types[] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newByMonth);
|
||||
$types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newByMonth);
|
||||
}
|
||||
|
||||
return $types;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -127,6 +127,7 @@ ErrorMailNotSend=An error occurred while sending email:
|
||||
NoCPforMonth=No leave this month.
|
||||
nbJours=Number days
|
||||
TitleAdminCP=Configuration of Leaves
|
||||
NoticePeriod=Notice period
|
||||
#Messages
|
||||
Hello=Hello
|
||||
HolidaysToValidate=Validate leave requests
|
||||
|
||||
@ -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
|
||||
|
||||
@ -151,4 +151,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
|
||||
@ -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
|
||||
|
||||
@ -293,7 +293,188 @@ 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))
|
||||
{
|
||||
$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")
|
||||
{
|
||||
$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 +491,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 +499,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">';
|
||||
@ -675,151 +834,6 @@ foreach ($listofreferent as $key => $value)
|
||||
}
|
||||
|
||||
|
||||
// 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();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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">';
|
||||
|
||||
@ -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.= '&search_idprof3='.htmlspecialchars($search_idprof3);
|
||||
$params.= '&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 ' ';
|
||||
@ -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>';
|
||||
@ -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>';
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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">';
|
||||
|
||||
@ -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 */
|
||||
/* ============================================================================== */
|
||||
|
||||
@ -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 */
|
||||
/* ============================================================================== */
|
||||
|
||||
@ -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 */
|
||||
/* ============================================================================== */
|
||||
|
||||
@ -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 */
|
||||
/* ============================================================================== */
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user