Merge branch 'develop' of github.com:Dolibarr/dolibarr into dev_contactdefault
This commit is contained in:
commit
2d3dd9ed3c
@ -20,4 +20,3 @@ class Aaa
|
|||||||
echo 'doaaa'."\n";
|
echo 'doaaa'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,4 +22,3 @@ class Bbb
|
|||||||
$globalbbb.='+bbb';
|
$globalbbb.='+bbb';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,9 @@
|
|||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
|
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod">
|
||||||
|
<severity>0</severity>
|
||||||
|
</rule>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<rule ref="Generic.Commenting.Todo" />
|
<rule ref="Generic.Commenting.Todo" />
|
||||||
|
|||||||
@ -132,12 +132,15 @@ if ($action == 'update') {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title = $langs->trans('ConfigAccountingExpert');
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
|
|
||||||
|
$linkback='';
|
||||||
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'accountancy');
|
||||||
|
|
||||||
|
|
||||||
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
||||||
|
|||||||
@ -160,12 +160,12 @@ if ($action == 'setenablesubsidiarylist') {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
$title= $langs->trans('ConfigAccountingExpert');
|
||||||
|
llxHeader('', $title);
|
||||||
$form = new Form($db);
|
|
||||||
|
|
||||||
|
$linkback='';
|
||||||
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'accountancy');
|
||||||
|
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
|
|||||||
@ -869,7 +869,7 @@ else
|
|||||||
|
|
||||||
$adht = new AdherentType($db);
|
$adht = new AdherentType($db);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewMember"));
|
print load_fiche_titre($langs->trans("NewMember"), '', 'members');
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
@ -1672,7 +1672,11 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! $adht->subscription)
|
if ($object->need_subscription == 0)
|
||||||
|
{
|
||||||
|
print $langs->trans("SubscriptionNotNeeded");
|
||||||
|
}
|
||||||
|
elseif (! $adht->subscription)
|
||||||
{
|
{
|
||||||
print $langs->trans("SubscriptionNotRecorded");
|
print $langs->trans("SubscriptionNotRecorded");
|
||||||
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
|
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
|
||||||
|
|||||||
@ -248,7 +248,7 @@ $form=new Form($db);
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("MembersCards"));
|
llxHeader('', $langs->trans("MembersCards"));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("LinkToGeneratedPages"));
|
print load_fiche_titre($langs->trans("LinkToGeneratedPages"), '', 'members');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("LinkToGeneratedPagesDesc").'</span><br>';
|
print '<span class="opacitymedium">'.$langs->trans("LinkToGeneratedPagesDesc").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -2178,7 +2178,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActive");
|
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription");
|
||||||
|
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActive");
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate");
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate");
|
||||||
else return $langs->trans("MemberStatusPaid");
|
else return $langs->trans("MemberStatusPaid");
|
||||||
}
|
}
|
||||||
@ -2188,7 +2189,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActiveShort");
|
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription");
|
||||||
|
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActiveShort");
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLateShort");
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLateShort");
|
||||||
else return $langs->trans("MemberStatusPaidShort");
|
else return $langs->trans("MemberStatusPaidShort");
|
||||||
}
|
}
|
||||||
@ -2198,7 +2200,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActiveShort");
|
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4').' '.$langs->trans("MemberStatusNoSubscriptionShort");
|
||||||
|
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActiveShort");
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLateShort");
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLateShort");
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaidShort");
|
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaidShort");
|
||||||
}
|
}
|
||||||
@ -2208,7 +2211,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
||||||
|
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
||||||
}
|
}
|
||||||
@ -2218,7 +2222,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraft");
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'), 'statut0').' '.$langs->trans("MemberStatusDraft");
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActive");
|
if ($need_subscription == 0) return img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4').' '.$langs->trans("MemberStatusNoSubscription");
|
||||||
|
elseif (! $date_end_subscription) return img_picto($langs->trans('MemberStatusActive'), 'statut1').' '.$langs->trans("MemberStatusActive");
|
||||||
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLate");
|
elseif ($date_end_subscription < time()) return img_picto($langs->trans('MemberStatusActiveLate'), 'statut3').' '.$langs->trans("MemberStatusActiveLate");
|
||||||
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaid");
|
else return img_picto($langs->trans('MemberStatusPaid'), 'statut4').' '.$langs->trans("MemberStatusPaid");
|
||||||
}
|
}
|
||||||
@ -2228,7 +2233,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusDraftShort").'</span> '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
if ($statut == -1) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusDraftShort").'</span> '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
||||||
elseif ($statut >= 1) {
|
elseif ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveShort").' </span>'.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
if ($need_subscription == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusNoSubscriptionShort").' </span>'.img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
||||||
|
elseif (! $date_end_subscription) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveShort").' </span>'.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
||||||
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLateShort").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
elseif ($date_end_subscription < time()) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusActiveLateShort").' </span>'.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
||||||
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaidShort").' </span>'.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
else return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusPaidShort").' </span>'.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
||||||
}
|
}
|
||||||
@ -2238,7 +2244,8 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0');
|
||||||
if ($statut >= 1) {
|
if ($statut >= 1) {
|
||||||
if (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
if ($need_subscription == 0) return $langs->trans("MemberStatusNoSubscription").' '.img_picto($langs->trans('MemberStatusNoSubscription'), 'statut4');
|
||||||
|
elseif (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1');
|
||||||
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3');
|
||||||
else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4');
|
||||||
}
|
}
|
||||||
@ -2301,9 +2308,11 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT a.rowid, a.datefin, a.statut";
|
$sql = "SELECT a.rowid, a.datefin, a.statut";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||||
$sql.= " WHERE a.statut = 1";
|
$sql.= ", ".MAIN_DB_PREFIX."adherent_type as t";
|
||||||
|
$sql.= " WHERE a.fk_adherent_type = t.rowid";
|
||||||
|
$sql.= " AND a.statut = 1";
|
||||||
$sql.= " AND a.entity IN (".getEntity('adherent').")";
|
$sql.= " AND a.entity IN (".getEntity('adherent').")";
|
||||||
$sql.= " AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')";
|
$sql.= " AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND t.subscription = 1)";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -104,8 +104,7 @@ $now=dol_now();
|
|||||||
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||||
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||||
//$sql.= " AND d.statut = 1 AND ((t.subscription = 0 AND d.datefin IS NULL) OR d.datefin >= '".$db->idate($now)."')";
|
$sql.= " AND d.statut = 1 AND (d.datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
|
||||||
$sql.= " AND d.statut = 1 AND d.datefin >= '".$db->idate($now)."'";
|
|
||||||
$sql.= " AND t.rowid = d.fk_adherent_type";
|
$sql.= " AND t.rowid = d.fk_adherent_type";
|
||||||
$sql.= " GROUP BY d.fk_adherent_type";
|
$sql.= " GROUP BY d.fk_adherent_type";
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,7 @@ $massaction=GETPOST('massaction', 'alpha');
|
|||||||
$show_files=GETPOST('show_files', 'int');
|
$show_files=GETPOST('show_files', 'int');
|
||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
|
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'memberslist'; // To manage different context of search
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$result=restrictedArea($user, 'adherent');
|
$result=restrictedArea($user, 'adherent');
|
||||||
@ -293,8 +294,8 @@ if ($search_town) $sql.= natural_search("d.town", $search_town);
|
|||||||
if ($search_zip) $sql.= natural_search("d.zip", $search_zip);
|
if ($search_zip) $sql.= natural_search("d.zip", $search_zip);
|
||||||
if ($search_state) $sql.= natural_search("state.nom", $search_state);
|
if ($search_state) $sql.= natural_search("state.nom", $search_state);
|
||||||
if ($search_country) $sql .= " AND d.country IN (".$search_country.')';
|
if ($search_country) $sql .= " AND d.country IN (".$search_country.')';
|
||||||
if ($filter == 'uptodate') $sql.=" AND datefin >= '".$db->idate($now)."'";
|
if ($filter == 'uptodate') $sql.=" AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
|
||||||
if ($filter == 'outofdate') $sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')";
|
if ($filter == 'outofdate') $sql.=" AND ((datefin IS NULL OR datefin < '".$db->idate($now)."') AND t.subscription = 1)";
|
||||||
|
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
@ -419,7 +420,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
$modelmail="member";
|
$modelmail="member";
|
||||||
|
|||||||
@ -56,9 +56,10 @@ $langs->loadLangs(array("companies","members"));
|
|||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
llxHeader();
|
$title = $langs->trans("SubscriptionsStatistics");
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("SubscriptionsStatistics"), $mesg);
|
print load_fiche_titre($title, '', 'members');
|
||||||
|
|
||||||
$dir=$conf->adherent->dir_temp;
|
$dir=$conf->adherent->dir_temp;
|
||||||
|
|
||||||
|
|||||||
@ -262,7 +262,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
$modelmail="subscription";
|
$modelmail="subscription";
|
||||||
|
|||||||
@ -248,7 +248,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
$object = new AdherentType($db);
|
$object = new AdherentType($db);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewMemberType"));
|
print load_fiche_titre($langs->trans("NewMemberType"), '', 'members');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -526,11 +526,11 @@ if ($rowid > 0)
|
|||||||
}
|
}
|
||||||
if ($filter == 'uptodate')
|
if ($filter == 'uptodate')
|
||||||
{
|
{
|
||||||
$sql.=" AND datefin >= '".$db->idate($now)."'";
|
$sql.=" AND (datefin >= '".$db->idate($now)."') OR t.subscription = 0)";
|
||||||
}
|
}
|
||||||
if ($filter == 'outofdate')
|
if ($filter == 'outofdate')
|
||||||
{
|
{
|
||||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
$sql.=" AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql.= " ".$db->order($sortfield, $sortorder);
|
$sql.= " ".$db->order($sortfield, $sortorder);
|
||||||
|
|||||||
@ -938,34 +938,35 @@ if ($action == 'disable_favorite')
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formadmin=new FormAdmin($db);
|
$formadmin=new FormAdmin($db);
|
||||||
|
|
||||||
llxHeader();
|
$title=$langs->trans("DictionarySetup");
|
||||||
|
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
$titre=$langs->trans("DictionarySetup");
|
|
||||||
$linkback='';
|
$linkback='';
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
$titre.=' - '.$langs->trans($tablib[$id]);
|
$title.=' - '.$langs->trans($tablib[$id]);
|
||||||
$linkback='<a href="'.$_SERVER['PHP_SELF'].'">'.$langs->trans("BackToDictionaryList").'</a>';
|
$linkback='<a href="'.$_SERVER['PHP_SELF'].'">'.$langs->trans("BackToDictionaryList").'</a>';
|
||||||
}
|
}
|
||||||
$titlepicto='title_setup';
|
$titlepicto='title_setup';
|
||||||
if ($id == 10 && GETPOST('from') == 'accountancy')
|
if ($id == 10 && GETPOST('from') == 'accountancy')
|
||||||
{
|
{
|
||||||
$titre=$langs->trans("MenuVatAccounts");
|
$title=$langs->trans("MenuVatAccounts");
|
||||||
$titlepicto='title_accountancy';
|
$titlepicto='accountancy';
|
||||||
}
|
}
|
||||||
if ($id == 7 && GETPOST('from') == 'accountancy')
|
if ($id == 7 && GETPOST('from') == 'accountancy')
|
||||||
{
|
{
|
||||||
$titre=$langs->trans("MenuTaxAccounts");
|
$title=$langs->trans("MenuTaxAccounts");
|
||||||
$titlepicto='title_accountancy';
|
$titlepicto='accountancy';
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($titre, $linkback, $titlepicto);
|
print load_fiche_titre($title, $linkback, $titlepicto);
|
||||||
|
|
||||||
if (empty($id))
|
if (empty($id))
|
||||||
{
|
{
|
||||||
print $langs->trans("DictionaryDesc");
|
print '<span class="opacitymedium">'.$langs->trans("DictionaryDesc");
|
||||||
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
|
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
|
||||||
print '<br>';
|
print '</span><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1697,7 +1698,6 @@ if ($id)
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1711,7 +1711,6 @@ else
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
//print '<td>'.$langs->trans("Module").'</td>';
|
|
||||||
print '<td colspan="2">'.$langs->trans("Dictionary").'</td>';
|
print '<td colspan="2">'.$langs->trans("Dictionary").'</td>';
|
||||||
print '<td>'.$langs->trans("Table").'</td>';
|
print '<td>'.$langs->trans("Table").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -1726,7 +1725,7 @@ else
|
|||||||
if ($showemptyline)
|
if ($showemptyline)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven"><td width="30%"> </td><td> </td><td> </td></tr>';
|
print '<tr class="oddeven"><td width="50%"> </td><td> </td><td> </td></tr>';
|
||||||
$showemptyline=0;
|
$showemptyline=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012-20113 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2019 Christophe Battarel <christophe@altairis.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -49,7 +50,8 @@ $modules = array(
|
|||||||
'DETAILS' => 'FCKeditorForProductDetails',
|
'DETAILS' => 'FCKeditorForProductDetails',
|
||||||
'USERSIGN' => 'FCKeditorForUserSignature',
|
'USERSIGN' => 'FCKeditorForUserSignature',
|
||||||
'MAILING' => 'FCKeditorForMailing',
|
'MAILING' => 'FCKeditorForMailing',
|
||||||
'MAIL' => 'FCKeditorForMail'
|
'MAIL' => 'FCKeditorForMail',
|
||||||
|
'TICKET' => 'FCKeditorForTicket'
|
||||||
);
|
);
|
||||||
// Conditions pour que l'option soit proposee
|
// Conditions pour que l'option soit proposee
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
@ -58,7 +60,8 @@ $conditions = array(
|
|||||||
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)),
|
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)),
|
||||||
'USERSIGN' => 1,
|
'USERSIGN' => 1,
|
||||||
'MAILING' => ! empty($conf->mailing->enabled),
|
'MAILING' => ! empty($conf->mailing->enabled),
|
||||||
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)),
|
||||||
|
'TICKET' => ! empty($conf->ticket->enabled)
|
||||||
);
|
);
|
||||||
// Picto
|
// Picto
|
||||||
$picto = array(
|
$picto = array(
|
||||||
@ -67,7 +70,8 @@ $picto = array(
|
|||||||
'DETAILS' => 'product',
|
'DETAILS' => 'product',
|
||||||
'USERSIGN' => 'user',
|
'USERSIGN' => 'user',
|
||||||
'MAILING' => 'email',
|
'MAILING' => 'email',
|
||||||
'MAIL' => 'email'
|
'MAIL' => 'email',
|
||||||
|
'TICKET' => 'ticket'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,7 @@ jQuery(document).ready(function() {
|
|||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("NewAsset"));
|
print load_fiche_titre($langs->trans("NewAsset"), '', 'accountancy');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|||||||
@ -316,7 +316,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
// Add code for pre mass action (confirmation or email presend form)
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
$topicmail="SendAssetsRef";
|
$topicmail="SendAssetsRef";
|
||||||
|
|||||||
@ -197,6 +197,7 @@ if ($action == 'confirm_delete' && $user->rights->asset->write)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
$helpurl='';
|
$helpurl='';
|
||||||
llxHeader('', $langs->trans("AssetsTypeSetup"), $helpurl);
|
llxHeader('', $langs->trans("AssetsTypeSetup"), $helpurl);
|
||||||
|
|
||||||
@ -237,7 +238,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
|
|||||||
@ -252,7 +252,7 @@ if ($conf->product->enabled || $conf->product->service)
|
|||||||
|
|
||||||
$nbno=$nbtotal=0;
|
$nbno=$nbtotal=0;
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'title_products');
|
print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"), '', 'products');
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
|
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
|
||||||
|
|||||||
@ -204,7 +204,7 @@ jQuery(document).ready(function() {
|
|||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("NewBOM"));
|
print load_fiche_titre($langs->trans("NewBOM"), '', 'cubes');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -237,7 +237,7 @@ if ($action == 'create')
|
|||||||
// Part to edit record
|
// Part to edit record
|
||||||
if (($id || $ref) && $action == 'edit')
|
if (($id || $ref) && $action == 'edit')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("BillOfMaterials"));
|
print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|||||||
@ -329,7 +329,7 @@ $newcardbutton='';
|
|||||||
// $newcardbutton.= '</a>';
|
// $newcardbutton.= '</a>';
|
||||||
//}
|
//}
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cubes', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
// Add code for pre mass action (confirmation or email presend form)
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
$topicmail="SendBillOfMaterialsRef";
|
$topicmail="SendBillOfMaterialsRef";
|
||||||
|
|||||||
@ -150,3 +150,140 @@ function printBookmarksList($aDb, $aLangs)
|
|||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add area with bookmarks in top menu
|
||||||
|
*
|
||||||
|
* @param DoliDb $aDb Database handler
|
||||||
|
* @param Translate $aLangs Object lang
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function printDropdownBookmarksList($aDb, $aLangs)
|
||||||
|
{
|
||||||
|
global $conf, $user;
|
||||||
|
|
||||||
|
$db = $aDb;
|
||||||
|
$langs = $aLangs;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
||||||
|
if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5;
|
||||||
|
|
||||||
|
$langs->load("bookmarks");
|
||||||
|
|
||||||
|
$url= $_SERVER["PHP_SELF"];
|
||||||
|
|
||||||
|
if (! empty($_SERVER["QUERY_STRING"]))
|
||||||
|
{
|
||||||
|
$url.=(dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):'');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
global $sortfield,$sortorder;
|
||||||
|
$tmpurl='';
|
||||||
|
// No urlencode, all param $url will be urlencoded later
|
||||||
|
if ($sortfield) $tmpurl.=($tmpurl?'&':'').'sortfield='.$sortfield;
|
||||||
|
if ($sortorder) $tmpurl.=($tmpurl?'&':'').'sortorder='.$sortorder;
|
||||||
|
if (is_array($_POST))
|
||||||
|
{
|
||||||
|
foreach($_POST as $key => $val)
|
||||||
|
{
|
||||||
|
if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$url.=($tmpurl?'?'.$tmpurl:'');
|
||||||
|
}
|
||||||
|
|
||||||
|
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||||
|
$searchForm.= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="" onsubmit="return false" >';
|
||||||
|
$searchForm.= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||||
|
$searchForm.= '</form>';
|
||||||
|
|
||||||
|
// Url to list bookmark
|
||||||
|
$listbtn = '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.DOL_URL_ROOT.'/bookmarks/list.php" >';
|
||||||
|
$listbtn.= '<span class="fa fa-list"></span> '.$langs->trans('Bookmarks').'</a>';
|
||||||
|
|
||||||
|
// Url to go on create new bookmark page
|
||||||
|
$newbtn = '';
|
||||||
|
if (! empty($user->rights->bookmark->creer))
|
||||||
|
{
|
||||||
|
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||||
|
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||||
|
$newbtn.= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
|
||||||
|
$newbtn.= '<span class="fa fa-star-o"></span> '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$bookmarkList='<div id="dropdown-bookmarks-list" >';
|
||||||
|
// Menu with all bookmarks
|
||||||
|
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
||||||
|
{
|
||||||
|
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
||||||
|
$sql.= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)";
|
||||||
|
$sql.= " AND entity IN (".getEntity('bookmarks').")";
|
||||||
|
$sql.= " ORDER BY position";
|
||||||
|
if ($resql = $db->query($sql) )
|
||||||
|
{
|
||||||
|
$i=0;
|
||||||
|
while ($i < $conf->global->BOOKMARKS_SHOW_IN_MENU && $obj = $db->fetch_object($resql))
|
||||||
|
{
|
||||||
|
$bookmarkList.='<a class="dropdown-item bookmark-item" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1?' target="_blank"':'').' href="'.dol_escape_htmltag($obj->url).'" >';
|
||||||
|
$bookmarkList.= dol_escape_htmltag($obj->title);
|
||||||
|
$bookmarkList.='</a>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$bookmarkList.='</div>';
|
||||||
|
|
||||||
|
$html= '';
|
||||||
|
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) {
|
||||||
|
$html.= '
|
||||||
|
<!-- search input -->
|
||||||
|
<div class="dropdown-header bookmark-header">
|
||||||
|
' . $searchForm . '
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
}
|
||||||
|
|
||||||
|
$html.= '
|
||||||
|
<!-- Menu Body -->
|
||||||
|
<div class="bookmark-body dropdown-body">
|
||||||
|
'.$bookmarkList.'
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$html.= '
|
||||||
|
<!-- Menu Footer-->
|
||||||
|
<div class="bookmark-footer">
|
||||||
|
'.$newbtn.$listbtn.'
|
||||||
|
<div style="clear:both;"></div>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) {
|
||||||
|
$html .= '<script>
|
||||||
|
$( document ).on("keyup", "#top-bookmark-search-input", function () {
|
||||||
|
|
||||||
|
var filter = $(this).val(), count = 0;
|
||||||
|
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
|
||||||
|
|
||||||
|
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
|
||||||
|
$(this).addClass("hidden-search-result");
|
||||||
|
} else {
|
||||||
|
$(this).removeClass("hidden-search-result");
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("#top-bookmark-search-filter-count").text(count);
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|||||||
@ -504,8 +504,8 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['a.datep2']['checked'])) print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"], "a.datep2", $param, '', 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['a.datep2']['checked'])) print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"], "a.datep2", $param, '', 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $param, "", "", $sortfield, $sortorder);
|
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $param, "", "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['a.fk_contact']['checked'])) print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "a.fk_contact", $param, "", "", $sortfield, $sortorder);
|
if (! empty($arrayfields['a.fk_contact']['checked'])) print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['a.fk_element']['checked'])) print_liste_field_titre($arrayfields['a.fk_element']['label'], $_SERVER["PHP_SELF"], "a.fk_element", $param, "", "", $sortfield, $sortorder);
|
if (! empty($arrayfields['a.fk_element']['checked'])) print_liste_field_titre($arrayfields['a.fk_element']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
@ -562,7 +562,7 @@ if ($resql)
|
|||||||
// User owner
|
// User owner
|
||||||
if (! empty($arrayfields['owner']['checked']))
|
if (! empty($arrayfields['owner']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="'.($conf->browser->name != 'chrome'?'':'tdoverflowmax100').'">'; // With edge and chrom the td overflow is not supported correctly when content is not full text.
|
print '<td class="tdoverflowmax150">'; // With edge and chrome the td overflow is not supported correctly when content is not full text.
|
||||||
if ($obj->fk_user_action > 0)
|
if ($obj->fk_user_action > 0)
|
||||||
{
|
{
|
||||||
$userstatic->fetch($obj->fk_user_action);
|
$userstatic->fetch($obj->fk_user_action);
|
||||||
@ -632,7 +632,7 @@ if ($resql)
|
|||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (! empty($arrayfields['s.nom']['checked'])) {
|
if (! empty($arrayfields['s.nom']['checked'])) {
|
||||||
print '<td class="tdoverflowmax100">';
|
print '<td class="tdoverflowmax150">';
|
||||||
if ($obj->socid > 0)
|
if ($obj->socid > 0)
|
||||||
{
|
{
|
||||||
$societestatic->id=$obj->socid;
|
$societestatic->id=$obj->socid;
|
||||||
@ -650,12 +650,11 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
if (! empty($arrayfields['a.fk_contact']['checked'])) {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
|
|
||||||
$actionstatic->fetchResources();
|
$actionstatic->fetchResources();
|
||||||
if(!empty($actionstatic->socpeopleassigned))
|
if(!empty($actionstatic->socpeopleassigned))
|
||||||
{
|
{
|
||||||
$contactList = array();
|
$contactList = array();
|
||||||
foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned)
|
foreach ($actionstatic->socpeopleassigned as $socpeopleassigned)
|
||||||
{
|
{
|
||||||
if(!isset($contactListCache[$socpeopleassigned['id']]))
|
if(!isset($contactListCache[$socpeopleassigned['id']]))
|
||||||
{
|
{
|
||||||
@ -663,8 +662,8 @@ if ($resql)
|
|||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
if($contact->fetch($socpeopleassigned['id'])>0)
|
if($contact->fetch($socpeopleassigned['id'])>0)
|
||||||
{
|
{
|
||||||
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 28);
|
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1, '', 0);
|
||||||
$contactList[] = $contact->getNomUrl(1, '', 28);
|
$contactList[] = $contact->getNomUrl(1, '', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -686,7 +685,7 @@ if ($resql)
|
|||||||
$contactstatic->phone_mobile=$obj->phone_mobile;
|
$contactstatic->phone_mobile=$obj->phone_mobile;
|
||||||
$contactstatic->phone_perso=$obj->phone_perso;
|
$contactstatic->phone_perso=$obj->phone_perso;
|
||||||
$contactstatic->country_id=$obj->country_id;
|
$contactstatic->country_id=$obj->country_id;
|
||||||
print $contactstatic->getNomUrl(1, '', 28);
|
print $contactstatic->getNomUrl(1, '', 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,7 +73,6 @@ $object->substitutionarrayfortest = $substitutionarray;
|
|||||||
// List of sending methods
|
// List of sending methods
|
||||||
$listofmethods=array();
|
$listofmethods=array();
|
||||||
$listofmethods['mail']='PHP mail function';
|
$listofmethods['mail']='PHP mail function';
|
||||||
//$listofmethods['simplemail']='Simplemail class';
|
|
||||||
$listofmethods['smtps']='SMTP/SMTPS socket library';
|
$listofmethods['smtps']='SMTP/SMTPS socket library';
|
||||||
|
|
||||||
|
|
||||||
@ -896,17 +895,23 @@ else
|
|||||||
print '<table class="border centpercent tableforfield">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td class="titlefield">'.$form->editfieldkey("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').'</td><td colspan="3">';
|
print '<tr><td class="titlefield">';
|
||||||
|
print $form->editfieldkey("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
|
print '</td><td>';
|
||||||
print $form->editfieldval("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
print $form->editfieldval("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// From
|
// From
|
||||||
print '<tr><td>'.$form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').'</td><td colspan="3">';
|
print '<tr><td>';
|
||||||
|
print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
|
print '</td><td>';
|
||||||
print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Errors to
|
// Errors to
|
||||||
print '<tr><td>'.$form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string').'</td><td colspan="3">';
|
print '<tr><td>';
|
||||||
|
print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
|
print '</td><td>';
|
||||||
print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1117,7 +1122,7 @@ else
|
|||||||
$htmltext.='</i>';
|
$htmltext.='</i>';
|
||||||
|
|
||||||
// Print mail content
|
// Print mail content
|
||||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto('<span class="hideonsmartphone">'.$langs->trans("AvailableVariables").'</span>', $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'generic');
|
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto('<span class="opacitymedium hideonsmartphone">'.$langs->trans("AvailableVariables").'</span>', $htmltext, 1, 'helpclickable', '', 0, 2, 'emailsubstitionhelp'), 'generic');
|
||||||
|
|
||||||
dol_fiche_head('', '', '', -1);
|
dol_fiche_head('', '', '', -1);
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ $help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES
|
|||||||
|
|
||||||
llxHeader("", $langs->trans("ProspectionArea"), $help_url);
|
llxHeader("", $langs->trans("ProspectionArea"), $help_url);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ProspectionArea"));
|
print load_fiche_titre($langs->trans("ProspectionArea"), '', 'commercial');
|
||||||
|
|
||||||
//print '<table width="100%" class="notopnoleftnoright">';
|
//print '<table width="100%" class="notopnoleftnoright">';
|
||||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||||
|
|||||||
@ -62,7 +62,8 @@ $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Ped
|
|||||||
|
|
||||||
llxHeader("", $langs->trans("Orders"), $help_url);
|
llxHeader("", $langs->trans("Orders"), $help_url);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("OrdersArea"));
|
|
||||||
|
print load_fiche_titre($langs->trans("OrdersArea"), '', 'commercial');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|||||||
@ -603,7 +603,7 @@ if ($resql)
|
|||||||
print $langs->trans("EventualyAddCategory").': ';
|
print $langs->trans("EventualyAddCategory").': ';
|
||||||
print Form::selectarray('cat', $options, GETPOST('cat'), 1);
|
print Form::selectarray('cat', $options, GETPOST('cat'), 1);
|
||||||
}
|
}
|
||||||
print '<br><div style="margin-top: 5px;">'.$langs->trans("ThenCheckLinesAndConciliate").' ';
|
print '<br><div style="margin-top: 5px;"><span class="opacitymedium">'.$langs->trans("ThenCheckLinesAndConciliate").'</span> ';
|
||||||
print '<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans("SaveStatementOnly").'">';
|
print '<input class="button" name="confirm_savestatement" type="submit" value="'.$langs->trans("SaveStatementOnly").'">';
|
||||||
print ' '.$langs->trans("or").' ';
|
print ' '.$langs->trans("or").' ';
|
||||||
print '<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans("Conciliate").'">';
|
print '<input class="button" name="confirm_reconcile" type="submit" value="'.$langs->trans("Conciliate").'">';
|
||||||
|
|||||||
@ -182,169 +182,6 @@ if ($action == 'confirm_editbankreceipt' && ! empty($oldbankreceipt) && ! empty(
|
|||||||
$action='view';
|
$action='view';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZIP creation
|
|
||||||
if ($action=="dl" && $numref > 0)
|
|
||||||
{
|
|
||||||
// TODO Replace this with a standard builddoc action that use a document generation module to build the ZIP
|
|
||||||
$log = '';
|
|
||||||
|
|
||||||
$outdir = $conf->bank->dir_temp.'/'.$numref.'-'.$object->label;
|
|
||||||
$outdirinvoices = $outdir.'/'.$langs->trans("BillsCustomers");
|
|
||||||
$outdirsupplierinvoices = $outdir.'/'.$langs->trans("BillsSuppliers");
|
|
||||||
|
|
||||||
dol_mkdir($outdir);
|
|
||||||
dol_mkdir($outdirinvoices);
|
|
||||||
dol_mkdir($outdirsupplierinvoices);
|
|
||||||
|
|
||||||
//$zipname = $object->label.'-'.$numref . '.zip';
|
|
||||||
//$zip = new ZipArchive();
|
|
||||||
//$zip->open($zipname, ZipArchive::OVERWRITE);
|
|
||||||
|
|
||||||
$sql = $sqlrequestforbankline;
|
|
||||||
|
|
||||||
$facturestatic=new Facture($db);
|
|
||||||
|
|
||||||
$resd = $db->query($sql);
|
|
||||||
if ($resd) {
|
|
||||||
$numd = $db->num_rows($resd);
|
|
||||||
$i = 0;
|
|
||||||
if ($numd > 0)
|
|
||||||
{
|
|
||||||
$objd = $db->fetch_object($resd);
|
|
||||||
|
|
||||||
$log.='Transaction '.$objd->rowid;
|
|
||||||
$links = $object->get_url($objd->rowid);
|
|
||||||
|
|
||||||
foreach($links as $key=>$val)
|
|
||||||
{
|
|
||||||
$link = ''; $upload_dir = '';
|
|
||||||
|
|
||||||
switch ($val['type']) {
|
|
||||||
case "payment":
|
|
||||||
$payment = new Paiement($db);
|
|
||||||
$payment->fetch($val['url_id']);
|
|
||||||
$arraybill = $payment->getBillsArray();
|
|
||||||
if (is_array($arraybill) && count($arraybill) > 0)
|
|
||||||
{
|
|
||||||
foreach ($arraybill as $billid)
|
|
||||||
{
|
|
||||||
$facturestatic->fetch($billid);
|
|
||||||
$subdir = get_exdir($facturestatic->id, 2, 0, 0, $facturestatic, 'invoice');
|
|
||||||
|
|
||||||
$arrayofinclusion=array(); // TODO Find a way to get doc ODT or other
|
|
||||||
// TODO Use get_exdir
|
|
||||||
$arrayofinclusion[]=preg_quote($facturestatic->ref.'.pdf', '/');
|
|
||||||
$listoffiles = dol_dir_list($conf->facture->dir_output.$subdir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true);
|
|
||||||
// build list of files with full path
|
|
||||||
$files = array();
|
|
||||||
foreach($listoffiles as $filefound)
|
|
||||||
{
|
|
||||||
if (strstr($filefound["name"], $facturestatic->ref))
|
|
||||||
{
|
|
||||||
$files[] = $uploaddir.'/'.$facturestatic->ref.'/'.$filefound["name"];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*var_dump($files);*/
|
|
||||||
//var_dump($listoffiles);
|
|
||||||
foreach($listoffiles as $key => $srcfileobj)
|
|
||||||
{
|
|
||||||
$srcfile = $srcfileobj['fullname'];
|
|
||||||
$destfile = $outdirinvoices.'/'.$srcfileobj['name'];
|
|
||||||
//var_dump($srcfile.' - '.$destfile);
|
|
||||||
dol_copy($srcfile, $destfile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "payment_supplier":
|
|
||||||
$payment = new PaiementFourn($db);
|
|
||||||
$payment->fetch($val['url_id']);
|
|
||||||
$arraybill = $payment->getBillsArray();
|
|
||||||
if (is_array($arraybill) && count($arraybill) > 0)
|
|
||||||
{
|
|
||||||
foreach ($arraybill as $billid)
|
|
||||||
{
|
|
||||||
$facturestatic->fetch($billid);
|
|
||||||
$subdir = get_exdir($facturestatic->id, 2, 0, 0, $facturestatic, 'invoice_supplier');
|
|
||||||
|
|
||||||
$arrayofinclusion=array(); // TODO Find a way to get doc ODT or other
|
|
||||||
// TODO Use get_exdir
|
|
||||||
$arrayofinclusion[]=preg_quote($facturestatic->ref.'.pdf', '/');
|
|
||||||
$listoffiles = dol_dir_list($conf->fournisseur->facture->dir_output.$subdir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true);
|
|
||||||
// build list of files with full path
|
|
||||||
$files = array();
|
|
||||||
foreach($listoffiles as $filefound)
|
|
||||||
{
|
|
||||||
if (strstr($filefound["name"], $facturestatic->ref))
|
|
||||||
{
|
|
||||||
$files[] = $uploaddir.'/'.$facturestatic->ref.'/'.$filefound["name"];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*var_dump($files);*/
|
|
||||||
//var_dump($listoffiles);
|
|
||||||
foreach($listoffiles as $key => $srcfileobj)
|
|
||||||
{
|
|
||||||
$srcfile = $srcfileobj['fullname'];
|
|
||||||
$destfile = $outdirinvoices.'/'.$srcfileobj['name'];
|
|
||||||
//var_dump($srcfile.' - '.$destfile);
|
|
||||||
dol_copy($srcfile, $destfile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "payment_expensereport":
|
|
||||||
/*$subdir = dol_sanitizeFileName($objd->refe);
|
|
||||||
$upload_dir = $conf->expensereport->dir_output . '/' . $subdir;*/
|
|
||||||
break;
|
|
||||||
case "payment_salary":
|
|
||||||
/*$subdir = dol_sanitizeFileName($objd->ids);
|
|
||||||
$upload_dir = $conf->salaries->dir_output . '/' . $subdir;*/
|
|
||||||
break;
|
|
||||||
case "payment_donation":
|
|
||||||
/*$subdir = get_exdir(null, 2, 0, 1, $objd, 'donation') . '/' . dol_sanitizeFileName($objd->idd);
|
|
||||||
$upload_dir = $conf->don->dir_output . '/' . $subdir;*/
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$log.="\n";
|
|
||||||
|
|
||||||
/*if (! empty($upload_dir))
|
|
||||||
{
|
|
||||||
$files = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1);
|
|
||||||
|
|
||||||
if (is_array($files)) {
|
|
||||||
foreach ($files as $file) {
|
|
||||||
$zip->addFile($file["fullname"], $file["name"]); //
|
|
||||||
$log .= $key . ',' . $file["name"] . "\n";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$log .= $key . ',' . $langs->trans("Nofile") . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($resd);
|
|
||||||
|
|
||||||
|
|
||||||
//$zip->addFromString('log '.$numref.'.csv', $log);
|
|
||||||
//$zip->close();
|
|
||||||
|
|
||||||
// /Then download the zipped file.
|
|
||||||
/*header('Content-Type: application/zip');
|
|
||||||
header('Content-disposition: attachment; filename=' . $zipname);
|
|
||||||
header('Content-Length: ' . filesize($zipname));
|
|
||||||
|
|
||||||
readfile($zipname);
|
|
||||||
|
|
||||||
exit;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -801,16 +638,10 @@ else
|
|||||||
print '<td class="right"><b>'.price(price2num($total, 'MT'))."</b></td><td> </td>";
|
print '<td class="right"><b>'.price(price2num($total, 'MT'))."</b></td><td> </td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
// Add a download button
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // Started a rewrite to make this feature more Dolibarr compliant. Still need dev to be completed.
|
|
||||||
{
|
|
||||||
// TODO Replace this with standard box to generate document.
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?num='.$numref.'&account='.$id.'&action=dl" class="butAction" name="Send" >'.$langs->trans('DownloadPackageWithAllDocuments')." </a>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -263,7 +263,7 @@ if ($action == 'create')
|
|||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'title_accountancy.png');
|
print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'invoicing');
|
||||||
|
|
||||||
dol_fiche_head('', '');
|
dol_fiche_head('', '');
|
||||||
|
|
||||||
|
|||||||
@ -172,7 +172,7 @@ if ($result)
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|||||||
@ -315,7 +315,7 @@ if ($action=="create" || $action=="start")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'title_bank.png');
|
print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
|
||||||
|
|||||||
@ -342,7 +342,7 @@ $newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
|||||||
$newcardbutton.= '</a>';
|
$newcardbutton.= '</a>';
|
||||||
//}
|
//}
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
// Add code for pre mass action (confirmation or email presend form)
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
$topicmail="SendCashControlRef";
|
$topicmail="SendCashControlRef";
|
||||||
|
|||||||
@ -2587,7 +2587,7 @@ if ($action == 'create')
|
|||||||
$facturestatic = new Facture($db);
|
$facturestatic = new Facture($db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element);
|
$extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans('NewBill'));
|
print load_fiche_titre($langs->trans('NewBill'), '', 'invoicing');
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
|
|||||||
@ -972,7 +972,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['
|
|||||||
*/
|
*/
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("CreateRepeatableInvoice"), '', 'title_accountancy.png');
|
print load_fiche_titre($langs->trans("CreateRepeatableInvoice"), '', 'invoicing');
|
||||||
|
|
||||||
$object = new Facture($db); // Source invoice
|
$object = new Facture($db); // Source invoice
|
||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|||||||
@ -314,7 +314,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("RepeatableInvoices"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
|
print_barre_liste($langs->trans("RepeatableInvoices"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
|
||||||
|
|
||||||
print $langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'<br><br>';
|
print $langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'<br><br>';
|
||||||
|
|
||||||
|
|||||||
@ -636,7 +636,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail="SendBillRef";
|
$topicmail="SendBillRef";
|
||||||
$modelmail="facture_send";
|
$modelmail="facture_send";
|
||||||
|
|||||||
@ -75,7 +75,7 @@ if ($mode == 'supplier')
|
|||||||
$dir=$conf->fournisseur->facture->dir_temp;
|
$dir=$conf->fournisseur->facture->dir_temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($title, $mesg, 'title_accountancy.png');
|
print load_fiche_titre($title, '', 'invoicing');
|
||||||
|
|
||||||
dol_mkdir($dir);
|
dol_mkdir($dir);
|
||||||
|
|
||||||
|
|||||||
@ -250,7 +250,7 @@ llxHeader('', $name);
|
|||||||
|
|
||||||
//$textprevyear="<a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current-1) . "\">".img_previous()."</a>";
|
//$textprevyear="<a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current-1) . "\">".img_previous()."</a>";
|
||||||
//$textnextyear=" <a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current+1) . "\">".img_next()."</a>";
|
//$textnextyear=" <a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current+1) . "\">".img_next()."</a>";
|
||||||
//print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear", 'title_accountancy.png');
|
//print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear", 'invoicing');
|
||||||
|
|
||||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
||||||
//report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode);
|
//report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ if ($user->rights->tax->charges->creer)
|
|||||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt);
|
$newcardbutton.= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt);
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments", $mysoc->country_code), $newcardbutton);
|
print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments", $mysoc->country_code), $newcardbutton, 'invoicing');
|
||||||
|
|
||||||
$sql = "SELECT rowid, amount, label, f.datev, f.datep";
|
$sql = "SELECT rowid, amount, label, f.datev, f.datep";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."localtax as f ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."localtax as f ";
|
||||||
|
|||||||
@ -46,7 +46,7 @@ $accountstatic=new Account($db);
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("ChequesArea"));
|
llxHeader('', $langs->trans("ChequesArea"));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ChequesArea"));
|
print load_fiche_titre($langs->trans("ChequesArea"), '', 'bank');
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|||||||
@ -222,7 +222,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
|
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|||||||
@ -88,7 +88,7 @@ $formother=new FormOther($db);
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$titre=($year?$langs->trans("PaymentsReportsForYear", $year):$langs->trans("PaymentsReports"));
|
$titre=($year?$langs->trans("PaymentsReportsForYear", $year):$langs->trans("PaymentsReports"));
|
||||||
print load_fiche_titre($titre, '', 'title_accountancy.png');
|
print load_fiche_titre($titre, '', 'invoicing');
|
||||||
|
|
||||||
// Formulaire de generation
|
// Formulaire de generation
|
||||||
print '<form method="post" action="rapport.php?year='.$year.'">';
|
print '<form method="post" action="rapport.php?year='.$year.'">';
|
||||||
|
|||||||
@ -243,7 +243,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
|
print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -188,11 +188,11 @@ if ($resql)
|
|||||||
if ($year)
|
if ($year)
|
||||||
{
|
{
|
||||||
$center=($year?"<a href='list.php?year=".($year-1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='list.php?year=".($year+1)."'>".img_next()."</a>":"");
|
$center=($year?"<a href='list.php?year=".($year-1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='list.php?year=".($year+1)."'>".img_next()."</a>":"");
|
||||||
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($mysoc->country_id) && empty($mysoc->country_code))
|
if (empty($mysoc->country_id) && empty($mysoc->country_code))
|
||||||
|
|||||||
@ -231,7 +231,7 @@ llxHeader('', $name);
|
|||||||
|
|
||||||
//$textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a>";
|
//$textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a>";
|
||||||
//$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>";
|
//$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>";
|
||||||
//print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png');
|
//print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'invoicing');
|
||||||
|
|
||||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
||||||
//report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode);
|
//report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode);
|
||||||
|
|||||||
@ -507,7 +507,7 @@ else
|
|||||||
|
|
||||||
$title = $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
|
$title = $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
|
||||||
$linkback='';
|
$linkback='';
|
||||||
print load_fiche_titre($title, $linkback, 'title_companies.png');
|
print load_fiche_titre($title, $linkback, 'address');
|
||||||
|
|
||||||
// Show errors
|
// Show errors
|
||||||
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
|
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
|
||||||
|
|||||||
@ -476,7 +476,7 @@ print '<input type="hidden" name="page" value="'.$page.'">';
|
|||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
||||||
|
|
||||||
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies.png', 0, $newcardbutton, '', $limit);
|
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
$modelmail="contact";
|
$modelmail="contact";
|
||||||
|
|||||||
@ -1571,7 +1571,7 @@ class ExtraFields
|
|||||||
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
|
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
|
||||||
*/
|
*/
|
||||||
if (! empty($help)) {
|
if (! empty($help)) {
|
||||||
$out .= $form->textwithpicto("", $help);
|
$out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3);
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,7 +136,7 @@ class Form
|
|||||||
if (! empty($notabletag)) $ret.=' ';
|
if (! empty($notabletag)) $ret.=' ';
|
||||||
if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='</td>';
|
if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='</td>';
|
||||||
if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='<td class="right">';
|
if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='<td class="right">';
|
||||||
if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='<a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
|
if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
|
||||||
if (! empty($notabletag) && $notabletag == 1) $ret.=' : ';
|
if (! empty($notabletag) && $notabletag == 1) $ret.=' : ';
|
||||||
if (! empty($notabletag) && $notabletag == 3) $ret.=' ';
|
if (! empty($notabletag) && $notabletag == 3) $ret.=' ';
|
||||||
if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='</td>';
|
if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret.='</td>';
|
||||||
@ -442,7 +442,7 @@ class Form
|
|||||||
* @see textwithpicto() Use thisfunction if you can.
|
* @see textwithpicto() Use thisfunction if you can.
|
||||||
* TODO Move this as static as soon as everybody use textwithpicto or @Form::textwithtooltip
|
* TODO Move this as static as soon as everybody use textwithpicto or @Form::textwithtooltip
|
||||||
*/
|
*/
|
||||||
public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
|
public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -458,8 +458,8 @@ class Form
|
|||||||
$htmltext=str_replace("\n", "", $htmltext);
|
$htmltext=str_replace("\n", "", $htmltext);
|
||||||
|
|
||||||
$extrastyle='';
|
$extrastyle='';
|
||||||
if ($direction < 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-left: 3px !important;'; }
|
if ($direction < 0) { $extracss=($extracss?$extracss.' ':'').($notabs != 3 ? 'inline-block' : ''); $extrastyle='padding: 0px; padding-left: 3px !important;'; }
|
||||||
if ($direction > 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-right: 3px !important;'; }
|
if ($direction > 0) { $extracss=($extracss?$extracss.' ':'').($notabs != 3 ? 'inline-block' : ''); $extrastyle='padding: 0px; padding-right: 3px !important;'; }
|
||||||
|
|
||||||
$classfortooltip='classfortooltip';
|
$classfortooltip='classfortooltip';
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ class Form
|
|||||||
}
|
}
|
||||||
if ($tooltipon == 2 || $tooltipon == 3)
|
if ($tooltipon == 2 || $tooltipon == 3)
|
||||||
{
|
{
|
||||||
$paramfortooltipimg=' class="'.$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'"';
|
$paramfortooltipimg=' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'"';
|
||||||
if ($tooltiptrigger == '') $paramfortooltipimg.=' title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip
|
if ($tooltiptrigger == '') $paramfortooltipimg.=' title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip
|
||||||
else $paramfortooltipimg.=' dolid="'.$tooltiptrigger.'"';
|
else $paramfortooltipimg.=' dolid="'.$tooltiptrigger.'"';
|
||||||
}
|
}
|
||||||
@ -519,15 +519,15 @@ class Form
|
|||||||
* @param string $text Text to show
|
* @param string $text Text to show
|
||||||
* @param string $htmltext Content of tooltip
|
* @param string $htmltext Content of tooltip
|
||||||
* @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon
|
* @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon
|
||||||
* @param string $type Type of picto ('info', 'help', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none'
|
* @param string $type Type of picto ('info', 'infoclickable', 'help', 'helpclickable', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none'
|
||||||
* @param string $extracss Add a CSS style to td, div or span tag
|
* @param string $extracss Add a CSS style to td, div or span tag
|
||||||
* @param int $noencodehtmltext Do not encode into html entity the htmltext
|
* @param int $noencodehtmltext Do not encode into html entity the htmltext
|
||||||
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
|
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
|
||||||
* @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none')
|
* @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable')
|
||||||
* @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only)
|
* @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only)
|
||||||
* @return string HTML code of text, picto, tooltip
|
* @return string HTML code of text, picto, tooltip
|
||||||
*/
|
*/
|
||||||
public function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2, $tooltiptrigger = '', $forcenowrap = 0)
|
public function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 3, $tooltiptrigger = '', $forcenowrap = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@ -541,7 +541,7 @@ class Form
|
|||||||
// If info or help with no javascript, show only text
|
// If info or help with no javascript, show only text
|
||||||
if (empty($conf->use_javascript_ajax))
|
if (empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
if ($type == 'info' || $type == 'help') return $text;
|
if ($type == 'info' || $type == 'infoclickable' || $type == 'help' || $type == 'helpclickable') return $text;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$alt = $htmltext;
|
$alt = $htmltext;
|
||||||
@ -552,7 +552,7 @@ class Form
|
|||||||
// If info or help with smartphone, show only text (tooltip hover can't works)
|
// If info or help with smartphone, show only text (tooltip hover can't works)
|
||||||
if (! empty($conf->dol_no_mouse_hover) && empty($tooltiptrigger))
|
if (! empty($conf->dol_no_mouse_hover) && empty($tooltiptrigger))
|
||||||
{
|
{
|
||||||
if ($type == 'info' || $type == 'help') return $text;
|
if ($type == 'info' || $type == 'infoclickable' || $type == 'help' || $type == 'helpclickable') return $text;
|
||||||
}
|
}
|
||||||
// If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone)
|
// If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone)
|
||||||
//if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger))
|
//if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger))
|
||||||
@ -563,12 +563,13 @@ class Form
|
|||||||
$img='';
|
$img='';
|
||||||
if ($type == 'info') $img = img_help(0, $alt);
|
if ($type == 'info') $img = img_help(0, $alt);
|
||||||
elseif ($type == 'help') $img = img_help(($tooltiptrigger != '' ? 2 : 1), $alt);
|
elseif ($type == 'help') $img = img_help(($tooltiptrigger != '' ? 2 : 1), $alt);
|
||||||
|
elseif ($type == 'helpclickable') $img = img_help(($tooltiptrigger != '' ? 2 : 1), $alt);
|
||||||
elseif ($type == 'superadmin') $img = img_picto($alt, 'redstar');
|
elseif ($type == 'superadmin') $img = img_picto($alt, 'redstar');
|
||||||
elseif ($type == 'admin') $img = img_picto($alt, 'star');
|
elseif ($type == 'admin') $img = img_picto($alt, 'star');
|
||||||
elseif ($type == 'warning') $img = img_warning($alt);
|
elseif ($type == 'warning') $img = img_warning($alt);
|
||||||
elseif ($type != 'none') $img = img_picto($alt, $type); // $type can be an image path
|
elseif ($type != 'none') $img = img_picto($alt, $type); // $type can be an image path
|
||||||
|
|
||||||
return $this->textwithtooltip($text, $htmltext, (($tooltiptrigger && ! $img)?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger, $forcenowrap);
|
return $this->textwithtooltip($text, $htmltext, ((($tooltiptrigger && ! $img) || strpos($type, 'clickable'))?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger, $forcenowrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -242,7 +242,7 @@ class FormTicket
|
|||||||
}
|
}
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||||
$uselocalbrowser = true;
|
$uselocalbrowser = true;
|
||||||
$doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser);
|
$doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_TICKET);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -782,6 +782,8 @@ class Translate
|
|||||||
{
|
{
|
||||||
$this->load("languages");
|
$this->load("languages");
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_LANGUAGES_ALLOWED) && ! in_array($dir, explode(',', $conf->global->MAIN_LANGUAGES_ALLOWED)) ) continue;
|
||||||
|
|
||||||
if ($usecode == 2)
|
if ($usecode == 2)
|
||||||
{
|
{
|
||||||
$langs_available[$dir] = $dir;
|
$langs_available[$dir] = $dir;
|
||||||
|
|||||||
@ -29,8 +29,8 @@ interface Database
|
|||||||
* Format a SQL IF
|
* Format a SQL IF
|
||||||
*
|
*
|
||||||
* @param string $test Test string (example: 'cd.statut=0', 'field IS NULL')
|
* @param string $test Test string (example: 'cd.statut=0', 'field IS NULL')
|
||||||
* @param string $resok resultat si test egal
|
* @param string $resok result if test is equal
|
||||||
* @param string $resko resultat si test non egal
|
* @param string $resko result if test is not equal
|
||||||
* @return string SQL string
|
* @return string SQL string
|
||||||
*/
|
*/
|
||||||
public function ifsql($test, $resok, $resko);
|
public function ifsql($test, $resok, $resko);
|
||||||
@ -103,7 +103,7 @@ interface Database
|
|||||||
/**
|
/**
|
||||||
* Return the number of lines in the result of a request INSERT, DELETE or UPDATE
|
* Return the number of lines in the result of a request INSERT, DELETE or UPDATE
|
||||||
*
|
*
|
||||||
* @param resource $resultset Curseur de la requete voulue
|
* @param resource $resultset Cursor of the desired request
|
||||||
* @return int Number of lines
|
* @return int Number of lines
|
||||||
* @see num_rows()
|
* @see num_rows()
|
||||||
*/
|
*/
|
||||||
@ -196,10 +196,10 @@ interface Database
|
|||||||
public function getPathOfRestore();
|
public function getPathOfRestore();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Annulation d'une transaction et retour aux anciennes valeurs
|
* Canceling a transaction and returning to old values
|
||||||
*
|
*
|
||||||
* @param string $log Add more log to default log line
|
* @param string $log Add more log to default log line
|
||||||
* @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
|
* @return int 1 if cancelation ok or transaction not open, 0 if error
|
||||||
*/
|
*/
|
||||||
public function rollback($log = '');
|
public function rollback($log = '');
|
||||||
|
|
||||||
@ -296,12 +296,12 @@ interface Database
|
|||||||
* Create a table into database
|
* Create a table into database
|
||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
* @param array $fields Associative table [field name][table of descriptions]
|
||||||
* @param string $primary_key Nom du champ qui sera la clef primaire
|
* @param string $primary_key Name of the field that will be the primary key
|
||||||
* @param string $type Type de la table
|
* @param string $type Type of the table
|
||||||
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
* @param array $unique_keys Associative array Name of fields that will be unique key => value
|
||||||
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
|
* @param array $fulltext_keys Field name table that will be indexed in fulltext
|
||||||
* @param array $keys Tableau des champs cles noms => valeur
|
* @param array $keys Table of key fields names => value
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null);
|
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null);
|
||||||
@ -330,8 +330,8 @@ interface Database
|
|||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @param string $field_name Name of field to add
|
* @param string $field_name Name of field to add
|
||||||
* @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre]
|
* @param string $field_desc Associative array of description of the field to insert [parameter name][parameter value]
|
||||||
* @param string $field_position Optionnel ex.: "after champtruc"
|
* @param string $field_position Optional ex .: "after field stuff"
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function DDLAddField($table, $field_name, $field_desc, $field_position = "");
|
public function DDLAddField($table, $field_name, $field_desc, $field_position = "");
|
||||||
@ -372,7 +372,7 @@ interface Database
|
|||||||
* Return a pointer of line with description of a table or field
|
* Return a pointer of line with description of a table or field
|
||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @param string $field Optionnel : Name of field if we want description of field
|
* @param string $field Optional : Name of field if we want description of field
|
||||||
* @return resource Resource
|
* @return resource Resource
|
||||||
*/
|
*/
|
||||||
public function DDLDescTable($table, $field = "");
|
public function DDLDescTable($table, $field = "");
|
||||||
@ -396,9 +396,9 @@ interface Database
|
|||||||
/**
|
/**
|
||||||
* Create a user and privileges to connect to database (even if database does not exists yet)
|
* Create a user and privileges to connect to database (even if database does not exists yet)
|
||||||
*
|
*
|
||||||
* @param string $dolibarr_main_db_host Ip serveur
|
* @param string $dolibarr_main_db_host Server IP
|
||||||
* @param string $dolibarr_main_db_user Nom user a creer
|
* @param string $dolibarr_main_db_user Username to create
|
||||||
* @param string $dolibarr_main_db_pass Mot de passe user a creer
|
* @param string $dolibarr_main_db_pass User password to create
|
||||||
* @param string $dolibarr_main_db_name Database name where user must be granted
|
* @param string $dolibarr_main_db_name Database name where user must be granted
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
@ -444,7 +444,7 @@ interface Database
|
|||||||
* List information of columns into a table.
|
* List information of columns into a table.
|
||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @return array Array with inforation on table
|
* @return array Array with information on table
|
||||||
*/
|
*/
|
||||||
public function DDLInfoTable($table);
|
public function DDLInfoTable($table);
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
@ -452,7 +452,7 @@ interface Database
|
|||||||
/**
|
/**
|
||||||
* Free last resultset used.
|
* Free last resultset used.
|
||||||
*
|
*
|
||||||
* @param resource $resultset Fre cursor
|
* @param resource $resultset Free cursor
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function free($resultset = null);
|
public function free($resultset = null);
|
||||||
@ -483,9 +483,9 @@ interface Database
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
|
* Returns the current line (as an object) for the resultset cursor
|
||||||
*
|
*
|
||||||
* @param resource $resultset Curseur de la requete voulue
|
* @param resource $resultset Cursor of the desired request
|
||||||
* @return Object Object result line or false if KO or end of cursor
|
* @return Object Object result line or false if KO or end of cursor
|
||||||
*/
|
*/
|
||||||
public function fetch_object($resultset);
|
public function fetch_object($resultset);
|
||||||
|
|||||||
@ -50,7 +50,7 @@ if (empty($conf->dol_no_mouse_hover))
|
|||||||
{
|
{
|
||||||
print 'jQuery(".classfortooltip").tooltip({
|
print 'jQuery(".classfortooltip").tooltip({
|
||||||
show: { collision: "flipfit", effect:\'toggle\', delay:50 },
|
show: { collision: "flipfit", effect:\'toggle\', delay:50 },
|
||||||
hide: { delay: 50 },
|
hide: { delay: 250 },
|
||||||
tooltipClass: "mytooltip",
|
tooltipClass: "mytooltip",
|
||||||
content: function () {
|
content: function () {
|
||||||
console.log("Return title for popup");
|
console.log("Return title for popup");
|
||||||
|
|||||||
@ -956,7 +956,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
{
|
{
|
||||||
$queryName = 'search_'.substr($key, 2);
|
$queryName = 'search_'.substr($key, 2);
|
||||||
if (GETPOST($queryName, 'alpha')){
|
if (GETPOST($queryName, 'alpha')){
|
||||||
$search[$key]=GETPOST($queryName, 'alpha');
|
$search[substr($key, 2)]=GETPOST($queryName, 'alpha');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element, '', 'search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element, '', 'search_');
|
||||||
@ -1057,11 +1057,10 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
||||||
if (in_array($key, array('statut'))){
|
if (in_array($key, array('statut'))){
|
||||||
print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0, 1),'1'=>$contactstatic->LibStatut(1, 1)), $search_status);
|
print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0, 1),'1'=>$contactstatic->LibStatut(1, 1)), $search_status);
|
||||||
} elseif (in_array($key, array('role'))) {
|
}elseif (in_array($key, array('role'))) {
|
||||||
print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles);
|
print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles);
|
||||||
} else{
|
} else {
|
||||||
$fieldName = substr($key, 2);
|
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||||
print sprintf('<input type="text" class="flat maxwidth75" name="search_%s" value="%s">', $fieldName, dol_escape_htmltag($search[$key]));
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3025,13 +3025,15 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
|
|
||||||
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
||||||
if (empty($srconly) && in_array($pictowithouttext, array(
|
if (empty($srconly) && in_array($pictowithouttext, array(
|
||||||
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note',
|
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
||||||
|
'address', 'bank', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'note',
|
||||||
'object_list','object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
'object_list','object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||||
'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
||||||
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench',
|
||||||
'jabber','skype','twitter','facebook','linkedin',
|
'jabber','skype','twitter','facebook','linkedin',
|
||||||
'chevron-left','chevron-right','chevron-down','chevron-top',
|
'chevron-left','chevron-right','chevron-down','chevron-top',
|
||||||
'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic'
|
'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic',
|
||||||
|
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda'
|
||||||
)
|
)
|
||||||
)) {
|
)) {
|
||||||
$fa='fa';
|
$fa='fa';
|
||||||
@ -3040,11 +3042,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
$facolor = ''; $fasize = '';
|
$facolor = ''; $fasize = '';
|
||||||
|
|
||||||
$arrayconvpictotofa = array(
|
$arrayconvpictotofa = array(
|
||||||
'setup'=>'cog', 'companies'=>'building', 'products'=>'box_open', 'commercial'=>'box-tie', 'invoicing'=>'file-invoice', 'accountancy'=>'coins', 'project'=>'project-diagram',
|
'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'project'=>'sitemap',
|
||||||
'hrm'=>'umbrella-beach', 'members'=>'user-friends', 'ticket'=>'sticky-note', 'generic'=>'folder-open',
|
'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open',
|
||||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on',
|
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on',
|
||||||
'bank'=>'bank', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork',
|
'bank'=>'bank', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork',
|
||||||
'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table'
|
'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table',
|
||||||
|
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'bank', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($pictowithouttext == 'switch_off') {
|
if ($pictowithouttext == 'switch_off') {
|
||||||
|
|||||||
@ -935,6 +935,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
{
|
{
|
||||||
$line1.=($line1?" ":"").$fromcompany->town;
|
$line1.=($line1?" ":"").$fromcompany->town;
|
||||||
}
|
}
|
||||||
|
// Country
|
||||||
|
if ($fromcompany->country)
|
||||||
|
{
|
||||||
|
$line1.=($line1?", ":"").$fromcompany->country;
|
||||||
|
}
|
||||||
// Phone
|
// Phone
|
||||||
if ($fromcompany->phone)
|
if ($fromcompany->phone)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -958,7 +958,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200);
|
$newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200);
|
||||||
$newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201);
|
$newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201);
|
||||||
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202);
|
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202);
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203);
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->rights->ficheinter->lire, '', '', '', 203);
|
||||||
$newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
|
$newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -256,8 +256,8 @@ class mailing_fraise extends MailingTargets
|
|||||||
$sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$this->db->escape($mailing_id).")";
|
$sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$this->db->escape($mailing_id).")";
|
||||||
// Filter on status
|
// Filter on status
|
||||||
if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1";
|
if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1";
|
||||||
if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND a.datefin >= '".$this->db->idate($now)."'";
|
if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND (a.datefin >= '".$this->db->idate($now)."' OR ta.subscription = 0)";
|
||||||
if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')";
|
if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND ta.subscription = 1)";
|
||||||
if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0";
|
if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0";
|
||||||
// Filter on date
|
// Filter on date
|
||||||
if ($dateendsubscriptionafter > 0) $sql.=" AND datefin > '".$this->db->idate($dateendsubscriptionafter)."'";
|
if ($dateendsubscriptionafter > 0) $sql.=" AND datefin > '".$this->db->idate($dateendsubscriptionafter)."'";
|
||||||
|
|||||||
@ -43,7 +43,7 @@ llxHeader("", $langs->trans("Tools"), "");
|
|||||||
|
|
||||||
$text=$langs->trans("Tools");
|
$text=$langs->trans("Tools");
|
||||||
|
|
||||||
print load_fiche_titre($text, '', 'generic');
|
print load_fiche_titre($text, '', 'wrench');
|
||||||
|
|
||||||
// Show description of content
|
// Show description of content
|
||||||
print '<div class="justify">'.$langs->trans("ToolsDesc").'</div><br><br>';
|
print '<div class="justify">'.$langs->trans("ToolsDesc").'</div><br><br>';
|
||||||
|
|||||||
@ -109,7 +109,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
{
|
{
|
||||||
print '<tr class="trextrafields_collapse'.$extrafields_collapse_num.'">';
|
print '<tr class="trextrafields_collapse'.$extrafields_collapse_num.'">';
|
||||||
print '<td class="titlefield">';
|
print '<td class="titlefield">';
|
||||||
print '<table width="100%" class="nobordernopadding">';
|
print '<table class="nobordernopadding centpercent">';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="';
|
print '<td class="';
|
||||||
//var_dump($action);exit;
|
//var_dump($action);exit;
|
||||||
@ -138,7 +138,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
{
|
{
|
||||||
$fieldid='id';
|
$fieldid='id';
|
||||||
if ($object->table_element == 'societe') $fieldid='socid';
|
if ($object->table_element == 'societe') $fieldid='socid';
|
||||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '&ignorecollapsesetup=1">' . img_edit().'</a></td>';
|
print '<td class="right"><a class="reposition editfielda" href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '&ignorecollapsesetup=1">' . img_edit().'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -318,7 +318,7 @@ if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
|
|||||||
|
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("AddDonation"));
|
print load_fiche_titre($langs->trans("AddDonation"), '', 'invoicing');
|
||||||
|
|
||||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -500,7 +500,7 @@ if (! empty($id) && $action == 'edit')
|
|||||||
print '<input type="hidden" name="amount" value="'.$object->amount.'">';
|
print '<input type="hidden" name="amount" value="'.$object->amount.'">';
|
||||||
|
|
||||||
|
|
||||||
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
|
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'invoicing');
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ if ($result)
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("DonationsArea"));
|
print load_fiche_titre($langs->trans("DonationsArea"), '', 'invoicing');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|||||||
@ -154,7 +154,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton);
|
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton);
|
||||||
|
|
||||||
if ($search_all)
|
if ($search_all)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -164,8 +164,9 @@ if ($action == 'add') {
|
|||||||
$newinter->fk_projet=$object->fk_projet;
|
$newinter->fk_projet=$object->fk_projet;
|
||||||
$newinter->fk_project=$object->fk_projet;
|
$newinter->fk_project=$object->fk_projet;
|
||||||
$newinter->fk_contrat=$object->fk_contrat;
|
$newinter->fk_contrat=$object->fk_contrat;
|
||||||
} else
|
} else {
|
||||||
$newinter->socid=GETPOST("socid");
|
$newinter->socid=GETPOST("socid");
|
||||||
|
}
|
||||||
|
|
||||||
$newinter->entity=$object->entity;
|
$newinter->entity=$object->entity;
|
||||||
$newinter->duree=$object->duree;
|
$newinter->duree=$object->duree;
|
||||||
@ -184,8 +185,9 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
if ($newfichinterid > 0) {
|
if ($newfichinterid > 0) {
|
||||||
// Now we add line of details
|
// Now we add line of details
|
||||||
foreach ($object->lines as $ficheinterligne)
|
foreach ($object->lines as $line) {
|
||||||
$newinter->addline($user, $newfichinterid, $ficheinterligne->desc, "", $ficheinterligne->duree, '');
|
$newinter->addline($user, $newfichinterid, $line->desc, '', $line->duree, '');
|
||||||
|
}
|
||||||
|
|
||||||
// on update le nombre d'inter crée à partir du modèle
|
// on update le nombre d'inter crée à partir du modèle
|
||||||
$object->updateNbGenDone();
|
$object->updateNbGenDone();
|
||||||
@ -210,13 +212,10 @@ if ($action == 'add') {
|
|||||||
} elseif ($action == 'setdate_when' && $user->rights->ficheinter->creer) {
|
} elseif ($action == 'setdate_when' && $user->rights->ficheinter->creer) {
|
||||||
// Set next date of execution
|
// Set next date of execution
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$date = dol_mktime(
|
$date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear'));
|
||||||
GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0,
|
|
||||||
GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear')
|
|
||||||
);
|
|
||||||
if (!empty($date)) $object->setNextDate($date);
|
if (!empty($date)) $object->setNextDate($date);
|
||||||
} elseif ($action == 'setnb_gen_max' && $user->rights->ficheinter->creer) {
|
} elseif ($action == 'setnb_gen_max' && $user->rights->ficheinter->creer) {
|
||||||
// Set max period
|
// Set max period
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->setMaxPeriod(GETPOST('nb_gen_max', 'int'));
|
$object->setMaxPeriod(GETPOST('nb_gen_max', 'int'));
|
||||||
}
|
}
|
||||||
@ -230,17 +229,16 @@ llxHeader('', $langs->trans("RepeatableInterventional"), 'ch-fichinter.html#s-fa
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$companystatic = new Societe($db);
|
$companystatic = new Societe($db);
|
||||||
if (! empty($conf->contrat->enabled))
|
if (! empty($conf->contrat->enabled)) {
|
||||||
$contratstatic = new Contrat($db);
|
$contratstatic = new Contrat($db);
|
||||||
if (! empty($conf->projet->enabled))
|
}
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
$projectstatic = new Project($db);
|
$projectstatic = new Project($db);
|
||||||
|
}
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$tmparray=dol_getdate($now);
|
$tmparray=dol_getdate($now);
|
||||||
$today = dol_mktime(
|
$today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); // Today is last second of current day
|
||||||
23, 59, 59,
|
|
||||||
$tmparray['mon'], $tmparray['mday'], $tmparray['year']
|
|
||||||
); // Today is last second of current day
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -248,13 +246,13 @@ $today = dol_mktime(
|
|||||||
* Create mode
|
* Create mode
|
||||||
*/
|
*/
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'commercial');
|
print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'fichinter');
|
||||||
|
|
||||||
$object = new Fichinter($db); // Source invoice
|
$object = new Fichinter($db); // Source invoice
|
||||||
//$object = new Managementfichinter($db); // Source invoice
|
//$object = new Managementfichinter($db); // Source invoice
|
||||||
|
|
||||||
if ($object->fetch($id, $ref) > 0) {
|
if ($object->fetch($id, $ref) > 0) {
|
||||||
print '<form action="fiche-rec.php" method="post">';
|
print '<form action="card-rec.php" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
print '<input type="hidden" name="fichinterid" value="'.$object->id.'">';
|
print '<input type="hidden" name="fichinterid" value="'.$object->id.'">';
|
||||||
@ -273,7 +271,7 @@ if ($action == 'create') {
|
|||||||
print '<tr><td>'.$langs->trans("Customer").'</td><td>';
|
print '<tr><td>'.$langs->trans("Customer").'</td><td>';
|
||||||
print $form->select_company($object->thirdparty->id, 'socid', '', 0, 1);
|
print $form->select_company($object->thirdparty->id, 'socid', '', 0, 1);
|
||||||
|
|
||||||
// .$object->thirdparty->getNomUrl(1,'customer').
|
//.$object->thirdparty->getNomUrl(1,'customer').
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $langs->trans("Comment");
|
print $langs->trans("Comment");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -295,10 +293,7 @@ if ($action == 'create') {
|
|||||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
|
||||||
// Duration
|
// Duration
|
||||||
print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
|
print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
|
||||||
print '<td colspan="3">'.convertSecondToTime(
|
print '<td colspan="3">'.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
|
||||||
$object->duration, 'all',
|
|
||||||
$conf->global->MAIN_DURATION_OF_WORKDAY
|
|
||||||
).'</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,10 +303,7 @@ print '<td colspan="3">'.convertSecondToTime(
|
|||||||
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
||||||
$projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project;
|
$projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project;
|
||||||
|
|
||||||
$numprojet = $formproject->select_projects(
|
$numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
|
||||||
$object->thirdparty->id, $projectid, 'projectid',
|
|
||||||
0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''
|
|
||||||
);
|
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id;
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id;
|
||||||
print '&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?action=create';
|
print '&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?action=create';
|
||||||
print '&socid='.$object->thirdparty->id.(!empty($id)?'&id='.$id:'').'">';
|
print '&socid='.$object->thirdparty->id.(!empty($id)?'&id='.$id:'').'">';
|
||||||
@ -342,26 +334,21 @@ $numprojet = $formproject->select_projects(
|
|||||||
print '<tr><td class="titlefieldcreate">';
|
print '<tr><td class="titlefieldcreate">';
|
||||||
print $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'));
|
print $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'));
|
||||||
print "</td><td>";
|
print "</td><td>";
|
||||||
print "<input type='text' name='frequency' value='".GETPOST('frequency', 'int')."' size='4' /> ";
|
print '<input type="text" name="frequency" value="'.GETPOST('frequency', 'int').'" size="4"> ';
|
||||||
print $form->selectarray(
|
print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m'));
|
||||||
'unit_frequency',
|
|
||||||
array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')),
|
|
||||||
(GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m')
|
|
||||||
);
|
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// First date of execution for cron
|
// First date of execution for cron
|
||||||
print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>";
|
print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>";
|
||||||
if ($date_next_execution != "")
|
if ($date_next_execution != "") {
|
||||||
$date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
$date_next_execution = (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
|
||||||
12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')
|
}
|
||||||
) : -1);
|
|
||||||
print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1);
|
print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Number max of generation
|
// Number max of generation
|
||||||
print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>";
|
print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>";
|
||||||
print '<input type="text" name="nb_gen_max" value="'.GETPOST('nb_gen_max').'" size="5" />';
|
print '<input type="text" name="nb_gen_max" value="'.GETPOST('nb_gen_max', 'int').'" size="5">';
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
@ -369,29 +356,31 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$title = $langs->trans("ProductsAndServices");
|
$title = $langs->trans("ProductsAndServices");
|
||||||
if (empty($conf->service->enabled))
|
if (empty($conf->service->enabled)) {
|
||||||
$title = $langs->trans("Products");
|
$title = $langs->trans("Products");
|
||||||
elseif (empty($conf->product->enabled))
|
} elseif (empty($conf->product->enabled)) {
|
||||||
$title = $langs->trans("Services");
|
$title = $langs->trans("Services");
|
||||||
|
}
|
||||||
|
|
||||||
print load_fiche_titre($title, '', '');
|
print load_fiche_titre($title, '', '');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Invoice lines
|
* Fichinter lines
|
||||||
*/
|
*/
|
||||||
print '<table class="notopnoleftnoright" width="100%">';
|
print '<table class="notopnoleftnoright" width="100%">';
|
||||||
print '<tr><td colspan="3">';
|
print '<tr><td colspan="3">';
|
||||||
|
|
||||||
$sql = 'SELECT l.*';
|
$sql = 'SELECT l.rowid, l.description, l.duree';
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet as l";
|
$sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet as l";
|
||||||
$sql.= " WHERE l.fk_fichinter= ".$object->id;
|
$sql.= " WHERE l.fk_fichinter= ".$object->id;
|
||||||
$sql.= " AND l.fk_product is null ";
|
//$sql.= " AND l.fk_product is null ";
|
||||||
$sql.= " ORDER BY l.rang";
|
$sql.= " ORDER BY l.rang";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0; $total = 0;
|
$i = 0;
|
||||||
|
$total = 0;
|
||||||
|
|
||||||
echo '<table class="noborder" width="100%">';
|
echo '<table class="noborder" width="100%">';
|
||||||
if ($num) {
|
if ($num) {
|
||||||
@ -413,15 +402,16 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
|
|
||||||
print $text.' '.nl2br($objp->description);
|
print $text.' '.nl2br($objp->description);
|
||||||
|
|
||||||
// Qty
|
// Duration
|
||||||
print '<td class="center">'.convertSecondToTime($objp->duree).'</td>';
|
print '<td class="center">'.convertSecondToTime($objp->duree).'</td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
} else
|
} else {
|
||||||
print $db->error();
|
print $db->error();
|
||||||
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -436,8 +426,9 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
dol_print_error('', "Error, no invoice ".$object->id);
|
dol_print_error('', "Error, no fichinter ".$object->id);
|
||||||
|
}
|
||||||
} elseif ($action == 'selsocforcreatefrommodel') {
|
} elseif ($action == 'selsocforcreatefrommodel') {
|
||||||
print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'commercial');
|
print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'commercial');
|
||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
@ -492,32 +483,25 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
$morehtmlref.=img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
$morehtmlref.=img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||||
}
|
}
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
|
$morehtmlref.= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref.= '<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$morehtmlref.= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
$morehtmlref.=$formproject->select_projects(
|
$morehtmlref.= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1
|
$morehtmlref.= '</form>';
|
||||||
);
|
|
||||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
|
||||||
$morehtmlref.='</form>';
|
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.=$form->form_project(
|
$morehtmlref.= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
$_SERVER['PHP_SELF'].'?id='.$object->id,
|
|
||||||
$object->socid, $object->fk_project,
|
|
||||||
'none', 0, 0, 0, 1
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'"';
|
$morehtmlref.= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'"';
|
||||||
$morehtmlref.='title="'.$langs->trans('ShowProject').'">';
|
$morehtmlref.= 'title="'.$langs->trans('ShowProject').'">';
|
||||||
$morehtmlref.=$proj->ref;
|
$morehtmlref.= $proj->ref;
|
||||||
$morehtmlref.='</a>';
|
$morehtmlref.= '</a>';
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.='';
|
$morehtmlref.= '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -605,12 +589,8 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print "<input type='text' name='frequency' value='".$object->frequency."' size='5' /> ";
|
print '<input type="text" name="frequency" value="'.$object->frequency.'" size="5"> ';
|
||||||
print $form->selectarray(
|
print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), ($object->unit_frequency?$object->unit_frequency:'m'));
|
||||||
'unit_frequency',
|
|
||||||
array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')),
|
|
||||||
($object->unit_frequency?$object->unit_frequency:'m')
|
|
||||||
);
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||||
print '</tr></table></form>';
|
print '</tr></table></form>';
|
||||||
@ -625,19 +605,13 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
// Date when
|
// Date when
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
if ( $user->rights->ficheinter->creer && ($action == 'date_when' || $object->frequency > 0)) {
|
if ( $user->rights->ficheinter->creer && ($action == 'date_when' || $object->frequency > 0)) {
|
||||||
print $form->editfieldkey(
|
print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day');
|
||||||
$langs->trans("NextDateToExecution"), 'date_when', $object->date_when,
|
|
||||||
$object, $user->rights->facture->creer, 'day'
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("NextDateToExecution");
|
print $langs->trans("NextDateToExecution");
|
||||||
}
|
}
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'date_when' || $object->frequency > 0) {
|
if ($action == 'date_when' || $object->frequency > 0) {
|
||||||
print $form->editfieldval(
|
print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day');
|
||||||
$langs->trans("NextDateToExecution"), 'date_when', $object->date_when,
|
|
||||||
$object, $user->rights->facture->creer, 'day'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -645,19 +619,13 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
// Max period / Rest period
|
// Max period / Rest period
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
if ($user->rights->ficheinter->creer && ($action == 'nb_gen_max' || $object->frequency > 0)) {
|
if ($user->rights->ficheinter->creer && ($action == 'nb_gen_max' || $object->frequency > 0)) {
|
||||||
print $form->editfieldkey(
|
print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer);
|
||||||
$langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max,
|
|
||||||
$object, $user->rights->facture->creer
|
|
||||||
);
|
|
||||||
} else
|
} else
|
||||||
print $langs->trans("MaxPeriodNumber");
|
print $langs->trans("MaxPeriodNumber");
|
||||||
|
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'nb_gen_max' || $object->frequency > 0) {
|
if ($action == 'nb_gen_max' || $object->frequency > 0) {
|
||||||
print $form->editfieldval(
|
print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'', $object, $user->rights->facture->creer);
|
||||||
$langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'',
|
|
||||||
$object, $user->rights->facture->creer
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
print '';
|
print '';
|
||||||
@ -671,10 +639,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
if ($object->frequency > 0) {
|
if ($object->frequency > 0) {
|
||||||
print '<br>';
|
print '<br>';
|
||||||
if (empty($conf->cron->enabled)) {
|
if (empty($conf->cron->enabled)) {
|
||||||
$txtinfoadmin=$langs->trans(
|
$txtinfoadmin = $langs->trans("EnableAndSetupModuleCron", $langs->transnoentitiesnoconv("Module2300Name"));
|
||||||
"EnableAndSetupModuleCron",
|
|
||||||
$langs->transnoentitiesnoconv("Module2300Name")
|
|
||||||
);
|
|
||||||
print info_admin($txtinfoadmin);
|
print info_admin($txtinfoadmin);
|
||||||
}
|
}
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
@ -709,10 +674,11 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$title = $langs->trans("ProductsAndServices");
|
$title = $langs->trans("ProductsAndServices");
|
||||||
if (empty($conf->service->enabled))
|
if (empty($conf->service->enabled)) {
|
||||||
$title = $langs->trans("Products");
|
$title = $langs->trans("Products");
|
||||||
elseif (empty($conf->product->enabled))
|
} elseif (empty($conf->product->enabled)) {
|
||||||
$title = $langs->trans("Services");
|
$title = $langs->trans("Services");
|
||||||
|
}
|
||||||
|
|
||||||
print load_fiche_titre($title);
|
print load_fiche_titre($title);
|
||||||
|
|
||||||
@ -850,8 +816,9 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
$companystatic->id=$objp->socid;
|
$companystatic->id=$objp->socid;
|
||||||
$companystatic->name=$objp->name;
|
$companystatic->name=$objp->name;
|
||||||
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||||
} else
|
} else {
|
||||||
print '<td>'.$langs->trans("None").'</td>';
|
print '<td>'.$langs->trans("None").'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($conf->contrat->enabled)) {
|
if (! empty($conf->contrat->enabled)) {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -916,14 +883,16 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
print '<tr class="oddeven"><td colspan="6">'.$langs->trans("NoneF").'</td></tr>';
|
print '<tr class="oddeven"><td colspan="10">'.$langs->trans("NoneF").'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -1646,10 +1646,9 @@ elseif ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create intervention model
|
// create intervention model
|
||||||
if ($conf->global->MAIN_FEATURE_LEVEL >=2 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) {
|
if ($conf->global->MAIN_FEATURES_LEVEL >=2 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) {
|
||||||
print '<div class="inline-block divButAction">';
|
print '<div class="inline-block divButAction">';
|
||||||
// This feature is not yet implemented
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableIntervention").'</a>';
|
||||||
print '<a class="butAction" title="'.$langs->trans("not yet implemented").'" href="'.DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableIntervention").'</a>';
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
814
htdocs/fichinter/class/fichinterrec.class.php
Normal file
814
htdocs/fichinter/class/fichinterrec.class.php
Normal file
@ -0,0 +1,814 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2016-2018 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file fichinterrec/class/fichinter-rec.class.php
|
||||||
|
* \ingroup facture
|
||||||
|
* \brief Fichier de la classe des factures recurentes
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Classe de gestion des factures recurrentes/Modeles
|
||||||
|
*/
|
||||||
|
class FichinterRec extends Fichinter
|
||||||
|
{
|
||||||
|
public $element = 'fichinterrec';
|
||||||
|
public $table_element = 'fichinter_rec';
|
||||||
|
public $table_element_line = 'fichinter_rec';
|
||||||
|
public $fk_element = 'fk_fichinter';
|
||||||
|
public $picto = 'intervention';
|
||||||
|
|
||||||
|
public $title;
|
||||||
|
public $number;
|
||||||
|
public $date;
|
||||||
|
public $amount;
|
||||||
|
public $remise;
|
||||||
|
public $tva;
|
||||||
|
public $total;
|
||||||
|
public $db_table;
|
||||||
|
public $propalid;
|
||||||
|
|
||||||
|
public $date_last_gen;
|
||||||
|
public $date_when;
|
||||||
|
public $nb_gen_done;
|
||||||
|
public $nb_gen_max;
|
||||||
|
|
||||||
|
public $rang;
|
||||||
|
public $special_code;
|
||||||
|
|
||||||
|
public $usenewprice = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
*/
|
||||||
|
public function __construct($db)
|
||||||
|
{
|
||||||
|
$this->db = $db;
|
||||||
|
|
||||||
|
//status dans l'ordre de l'intervention
|
||||||
|
$this->statuts[0]='Draft';
|
||||||
|
$this->statuts[1]='Closed';
|
||||||
|
|
||||||
|
$this->statuts_short[0]='Draft';
|
||||||
|
$this->statuts_short[1]='Closed';
|
||||||
|
|
||||||
|
$this->statuts_logo[0]='statut0';
|
||||||
|
$this->statuts_logo[1]='statut1';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the label status
|
||||||
|
*
|
||||||
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||||
|
* @return string Label
|
||||||
|
*/
|
||||||
|
public function getLibStatut($mode = 0)
|
||||||
|
{
|
||||||
|
return $this->LibStatut($this->statut, $mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a predefined fichinter
|
||||||
|
*
|
||||||
|
* @param User $user User object
|
||||||
|
* @param int $notrigger no trigger
|
||||||
|
* @return int <0 if KO, id of fichinter if OK
|
||||||
|
*/
|
||||||
|
public function create($user, $notrigger = 0)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
|
// Clean parameters
|
||||||
|
$this->title = trim($this->title);
|
||||||
|
$this->description = trim($this->description);
|
||||||
|
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
// Load fichinter model
|
||||||
|
$fichintsrc = new Fichinter($this->db);
|
||||||
|
|
||||||
|
$result = $fichintsrc->fetch($this->id_origin);
|
||||||
|
$result = $fichintsrc->fetch_lines(1); // to get all lines
|
||||||
|
|
||||||
|
|
||||||
|
if ($result > 0) {
|
||||||
|
// On positionne en mode brouillon la facture
|
||||||
|
$this->brouillon = 1;
|
||||||
|
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."fichinter_rec (";
|
||||||
|
$sql.= "titre";
|
||||||
|
$sql.= ", fk_soc";
|
||||||
|
$sql.= ", entity";
|
||||||
|
$sql.= ", datec";
|
||||||
|
$sql.= ", duree";
|
||||||
|
$sql.= ", description";
|
||||||
|
$sql.= ", note_private";
|
||||||
|
$sql.= ", note_public";
|
||||||
|
$sql.= ", fk_user_author";
|
||||||
|
$sql.= ", fk_projet";
|
||||||
|
$sql.= ", fk_contrat";
|
||||||
|
$sql.= ", modelpdf";
|
||||||
|
|
||||||
|
$sql.= ", frequency";
|
||||||
|
$sql.= ", unit_frequency";
|
||||||
|
$sql.= ", date_when";
|
||||||
|
$sql.= ", date_last_gen";
|
||||||
|
$sql.= ", nb_gen_done";
|
||||||
|
$sql.= ", nb_gen_max";
|
||||||
|
// $sql.= ", auto_validate";
|
||||||
|
|
||||||
|
$sql.= ") VALUES (";
|
||||||
|
$sql.= "'".$this->db->escape($this->title)."'";
|
||||||
|
$sql.= ", ".($this->socid >0 ? $this->socid : 'null');
|
||||||
|
$sql.= ", ".$conf->entity;
|
||||||
|
$sql.= ", '".$this->db->idate($now)."'";
|
||||||
|
$sql.= ", ".(!empty($fichintsrc->duree)?$fichintsrc->duree:'0');
|
||||||
|
$sql.= ", ".(!empty($this->description)?("'".$this->db->escape($this->description)."'"):"null");
|
||||||
|
$sql.= ", ".(!empty($fichintsrc->note_private)?("'".$this->db->escape($fichintsrc->note_private)."'"):"null");
|
||||||
|
$sql.= ", ".(!empty($fichintsrc->note_public)?("'".$this->db->escape($fichintsrc->note_public)."'"):"null");
|
||||||
|
$sql.= ", '".$user->id."'";
|
||||||
|
// si c'est la même société on conserve les liens vers le projet et le contrat
|
||||||
|
if ($this->socid == $fichintsrc->socid) {
|
||||||
|
$sql.= ", ".(! empty($fichintsrc->fk_project)?$fichintsrc->fk_project:"null");
|
||||||
|
$sql.= ", ".(! empty($fichintsrc->fk_contrat)?$fichintsrc->fk_contrat:"null");
|
||||||
|
} else {
|
||||||
|
$sql.= ", null, null";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql.= ", ".(! empty($fichintsrc->modelpdf)?"'".$this->db->escape($fichintsrc->modelpdf)."'":"''");
|
||||||
|
|
||||||
|
// récurrence
|
||||||
|
$sql.= ", ".(! empty($this->frequency)?$this->frequency:"null");
|
||||||
|
$sql.= ", '".$this->db->escape($this->unit_frequency)."'";
|
||||||
|
$sql.= ", ".(!empty($this->date_when)?"'".$this->db->idate($this->date_when)."'":'null');
|
||||||
|
$sql.= ", ".(!empty($this->date_last_gen)?"'".$this->db->idate($this->date_last_gen)."'":'null');
|
||||||
|
$sql.= ", 0"; // we start à 0
|
||||||
|
$sql.= ", ".$this->nb_gen_max;
|
||||||
|
// $sql.= ", ".$this->auto_validate;
|
||||||
|
$sql.= ")";
|
||||||
|
|
||||||
|
if ($this->db->query($sql)) {
|
||||||
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lines
|
||||||
|
*/
|
||||||
|
$num=count($fichintsrc->lines);
|
||||||
|
for ($i = 0; $i < $num; $i++) {
|
||||||
|
//$result=$fichintlignesrc->fetch($fichintsrc->lines[$i]->id);
|
||||||
|
|
||||||
|
//var_dump($fichintsrc->lines[$i]);
|
||||||
|
$result_insert = $this->addline(
|
||||||
|
$fichintsrc->lines[$i]->desc,
|
||||||
|
$fichintsrc->lines[$i]->duration,
|
||||||
|
$fichintsrc->lines[$i]->datei,
|
||||||
|
$fichintsrc->lines[$i]->rang,
|
||||||
|
$fichintsrc->lines[$i]->subprice,
|
||||||
|
$fichintsrc->lines[$i]->qty,
|
||||||
|
$fichintsrc->lines[$i]->tva_tx,
|
||||||
|
$fichintsrc->lines[$i]->fk_product,
|
||||||
|
$fichintsrc->lines[$i]->remise_percent,
|
||||||
|
'HT',
|
||||||
|
0,
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
$fichintsrc->lines[$i]->product_type,
|
||||||
|
$fichintsrc->lines[$i]->special_code,
|
||||||
|
$fichintsrc->lines[$i]->label,
|
||||||
|
$fichintsrc->lines[$i]->fk_unit
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($result_insert < 0)
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error)
|
||||||
|
$this->db->rollback();
|
||||||
|
else {
|
||||||
|
$this->db->commit();
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error=$this->db->error().' sql='.$sql;
|
||||||
|
$this->db->rollback();
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recupere l'objet facture et ses lignes de factures
|
||||||
|
*
|
||||||
|
* @param int $rowid Id of object to load
|
||||||
|
* @param string $ref Reference of fichinter
|
||||||
|
* @param string $ref_ext External reference of fichinter
|
||||||
|
* @param int $ref_int Internal reference of other object
|
||||||
|
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||||
|
*/
|
||||||
|
public function fetch($rowid = 0, $ref = '', $ref_ext = '', $ref_int = '')
|
||||||
|
{
|
||||||
|
$sql = 'SELECT f.titre, f.fk_soc';
|
||||||
|
$sql.= ', f.datec, f.duree, f.fk_projet, f.fk_contrat, f.description';
|
||||||
|
$sql.= ', f.note_private, f.note_public, f.fk_user_author';
|
||||||
|
$sql.= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.auto_validate';
|
||||||
|
$sql.= ', f.note_private, f.note_public, f.fk_user_author';
|
||||||
|
|
||||||
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'fichinter_rec as f';
|
||||||
|
if ($rowid >0 ) $sql.= ' WHERE f.rowid='.$rowid;
|
||||||
|
elseif ($ref) $sql.= " WHERE f.titre='".$this->db->escape($ref)."'";
|
||||||
|
|
||||||
|
/* This field are not used for template fichinter
|
||||||
|
if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||||
|
if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'";
|
||||||
|
*/
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::fetch rowid=".$rowid, LOG_DEBUG);
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
if ($this->db->num_rows($result)) {
|
||||||
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
$this->id = $rowid;
|
||||||
|
$this->titre = $obj->titre;
|
||||||
|
$this->ref = $obj->titre;
|
||||||
|
$this->description = $obj->description;
|
||||||
|
$this->datec = $obj->datec;
|
||||||
|
$this->socid = $obj->fk_soc;
|
||||||
|
$this->statut = 0;
|
||||||
|
$this->fk_project = $obj->fk_projet;
|
||||||
|
$this->fk_contrat = $obj->fk_contrat;
|
||||||
|
$this->note_private = $obj->note_private;
|
||||||
|
$this->note_public = $obj->note_public;
|
||||||
|
$this->user_author = $obj->fk_user_author;
|
||||||
|
$this->modelpdf = $obj->model_pdf;
|
||||||
|
$this->rang = $obj->rang;
|
||||||
|
$this->special_code = $obj->special_code;
|
||||||
|
$this->frequency = $obj->frequency;
|
||||||
|
$this->unit_frequency = $obj->unit_frequency;
|
||||||
|
$this->date_when = $this->db->jdate($obj->date_when);
|
||||||
|
$this->date_last_gen = $this->db->jdate($obj->date_last_gen);
|
||||||
|
$this->nb_gen_done = $obj->nb_gen_done;
|
||||||
|
$this->nb_gen_max = $obj->nb_gen_max;
|
||||||
|
$this->auto_validate = $obj->auto_validate;
|
||||||
|
|
||||||
|
$this->brouillon = 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lines
|
||||||
|
*/
|
||||||
|
$result=$this->fetch_lines();
|
||||||
|
if ($result < 0) {
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->error='Interventional with id '.$rowid.' not found sql='.$sql;
|
||||||
|
dol_syslog(get_class($this).'::Fetch Error '.$this->error, LOG_ERR);
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
/**
|
||||||
|
* Recupere les lignes de factures predefinies dans this->lines
|
||||||
|
* @param int $sall sall
|
||||||
|
*
|
||||||
|
* @return int 1 if OK, < 0 if KO
|
||||||
|
*/
|
||||||
|
public function fetch_lines($sall = 0)
|
||||||
|
{
|
||||||
|
// phpcs:enable
|
||||||
|
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, ';
|
||||||
|
$sql.= ' l.price, l.qty, l.tva_tx, l.remise, l.remise_percent, l.subprice, l.duree, ';
|
||||||
|
$sql.= ' l.total_ht, l.total_tva, l.total_ttc,';
|
||||||
|
$sql.= ' l.rang, l.special_code,';
|
||||||
|
$sql.= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,';
|
||||||
|
$sql.= ' p.label as product_label, p.description as product_desc';
|
||||||
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet_rec as l';
|
||||||
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||||
|
$sql.= ' WHERE l.fk_fichinter = '.$this->id;
|
||||||
|
|
||||||
|
dol_syslog('FichInter-rec::fetch_lines', LOG_DEBUG);
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
$num = $this->db->num_rows($result);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num) {
|
||||||
|
$objp = $this->db->fetch_object($result);
|
||||||
|
$line = new FichinterLigne($this->db);
|
||||||
|
|
||||||
|
$line->rowid = $objp->rowid;
|
||||||
|
$line->label = $objp->custom_label; // Label line
|
||||||
|
$line->desc = $objp->description; // Description line
|
||||||
|
$line->product_type = $objp->product_type; // Type of line
|
||||||
|
$line->product_ref = $objp->product_ref; // Ref product
|
||||||
|
$line->libelle = $objp->product_label; // deprecated
|
||||||
|
$line->product_label = $objp->product_label; // Label product
|
||||||
|
$line->product_desc = $objp->product_desc; // Description product
|
||||||
|
$line->fk_product_type = $objp->fk_product_type; // Type of product
|
||||||
|
$line->qty = $objp->qty;
|
||||||
|
$line->duree = $objp->duree;
|
||||||
|
$line->duration = $objp->duree;
|
||||||
|
$line->datei = $objp->date;
|
||||||
|
$line->subprice = $objp->subprice;
|
||||||
|
$line->tva_tx = $objp->tva_tx;
|
||||||
|
$line->remise_percent = $objp->remise_percent;
|
||||||
|
$line->fk_remise_except = $objp->fk_remise_except;
|
||||||
|
$line->fk_product = $objp->fk_product;
|
||||||
|
$line->date_start = $objp->date_start;
|
||||||
|
$line->date_end = $objp->date_end;
|
||||||
|
$line->date_start = $objp->date_start;
|
||||||
|
$line->date_end = $objp->date_end;
|
||||||
|
$line->info_bits = $objp->info_bits;
|
||||||
|
$line->total_ht = $objp->total_ht;
|
||||||
|
$line->total_tva = $objp->total_tva;
|
||||||
|
$line->total_ttc = $objp->total_ttc;
|
||||||
|
$line->code_ventilation = $objp->fk_code_ventilation;
|
||||||
|
$line->rang = $objp->rang;
|
||||||
|
$line->special_code = $objp->special_code;
|
||||||
|
$line->fk_unit = $objp->fk_unit;
|
||||||
|
|
||||||
|
// Ne plus utiliser
|
||||||
|
$line->price = $objp->price;
|
||||||
|
$line->remise = $objp->remise;
|
||||||
|
|
||||||
|
$this->lines[$i] = $line;
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->free($result);
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete template fichinter rec
|
||||||
|
*
|
||||||
|
* @param int $rowid Id of fichinter rec to delete. If empty, we delete current instance of fichinter rec
|
||||||
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
|
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function delete($rowid = 0, $notrigger = 0, $idwarehouse = -1)
|
||||||
|
{
|
||||||
|
if (empty($rowid)) $rowid=$this->id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG);
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet_rec WHERE fk_fichinter = ".$rowid;
|
||||||
|
dol_syslog($sql);
|
||||||
|
if ($this->db->query($sql)) {
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter_rec WHERE rowid = ".$rowid;
|
||||||
|
dol_syslog($sql);
|
||||||
|
if (! $this->db->query($sql)) {
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
$error=-1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
$error=-2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error) {
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a line to fichinter rec
|
||||||
|
*
|
||||||
|
* @param string $desc Description de la ligne
|
||||||
|
* @param integer $duration Durée
|
||||||
|
* @param string $datei Date
|
||||||
|
* @param int $rang Position of line
|
||||||
|
* @param double $pu_ht Prix unitaire HT (> 0 even for credit note)
|
||||||
|
* @param double $qty Quantite
|
||||||
|
* @param double $txtva Taux de tva force, sinon -1
|
||||||
|
* @param int $fk_product Id du produit/service predefini
|
||||||
|
* @param double $remise_percent Pourcentage de remise de la ligne
|
||||||
|
* @param string $price_base_type HT or TTC
|
||||||
|
* @param int $info_bits Bits de type de lignes
|
||||||
|
* @param int $fk_remise_except Id remise
|
||||||
|
* @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note)
|
||||||
|
* @param int $type Type of line (0=product, 1=service)
|
||||||
|
* @param int $special_code Special code
|
||||||
|
* @param string $label Label of the line
|
||||||
|
* @param string $fk_unit Unit
|
||||||
|
* @return int <0 if KO, Id of line if OK
|
||||||
|
*/
|
||||||
|
public function addline($desc, $duration, $datei, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null)
|
||||||
|
{
|
||||||
|
global $mysoc;
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
|
|
||||||
|
// Check parameters
|
||||||
|
if ($type < 0) return -1;
|
||||||
|
|
||||||
|
if ($this->brouillon) {
|
||||||
|
// Clean parameters
|
||||||
|
$remise_percent = price2num($remise_percent);
|
||||||
|
$qty = price2num($qty);
|
||||||
|
if (! $qty) $qty=1;
|
||||||
|
if (! $info_bits) $info_bits=0;
|
||||||
|
$pu_ht = price2num($pu_ht);
|
||||||
|
$pu_ttc = price2num($pu_ttc);
|
||||||
|
$txtva = price2num($txtva);
|
||||||
|
|
||||||
|
if ($price_base_type=='HT') {
|
||||||
|
$pu=$pu_ht;
|
||||||
|
} else {
|
||||||
|
$pu=$pu_ttc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Calcul du total TTC et de la TVA pour la ligne a partir de
|
||||||
|
// qty, pu, remise_percent et txtva
|
||||||
|
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||||
|
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||||
|
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, 0, 0, 0, $price_base_type, $info_bits, $type, $mysoc);
|
||||||
|
|
||||||
|
$total_ht = $tabprice[0];
|
||||||
|
$total_tva = $tabprice[1];
|
||||||
|
$total_ttc = $tabprice[2];
|
||||||
|
|
||||||
|
$product_type = $type;
|
||||||
|
if ($fk_product) {
|
||||||
|
$product = new Product($this->db);
|
||||||
|
$result = $product->fetch($fk_product);
|
||||||
|
$product_type = $product->type;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."fichinterdet_rec (";
|
||||||
|
$sql.= "fk_fichinter";
|
||||||
|
$sql.= ", label";
|
||||||
|
$sql.= ", description";
|
||||||
|
$sql.= ", date";
|
||||||
|
$sql.= ", duree";
|
||||||
|
//$sql.= ", price";
|
||||||
|
//$sql.= ", qty";
|
||||||
|
//$sql.= ", tva_tx";
|
||||||
|
$sql.= ", fk_product";
|
||||||
|
$sql.= ", product_type";
|
||||||
|
$sql.= ", remise_percent";
|
||||||
|
//$sql.= ", subprice";
|
||||||
|
$sql.= ", remise";
|
||||||
|
$sql.= ", total_ht";
|
||||||
|
$sql.= ", total_tva";
|
||||||
|
$sql.= ", total_ttc";
|
||||||
|
$sql.= ", rang";
|
||||||
|
//$sql.= ", special_code";
|
||||||
|
$sql.= ", fk_unit";
|
||||||
|
$sql.= ") VALUES (";
|
||||||
|
$sql.= (int) $this->id;
|
||||||
|
$sql.= ", ".(! empty($label)?"'".$this->db->escape($label)."'":"null");
|
||||||
|
$sql.= ", ".(! empty($desc)?"'".$this->db->escape($desc)."'":"null");
|
||||||
|
$sql.= ", ".(! empty($datei)?"'".$this->db->idate($datei)."'":"null");
|
||||||
|
$sql.= ", ".$duration;
|
||||||
|
//$sql.= ", ".price2num($pu_ht);
|
||||||
|
//$sql.= ", ".(!empty($qty)? $qty :(!empty($duration)? $duration :"null"));
|
||||||
|
//$sql.= ", ".price2num($txtva);
|
||||||
|
$sql.= ", ".(! empty($fk_product)? $fk_product :"null");
|
||||||
|
$sql.= ", ".$product_type;
|
||||||
|
$sql.= ", ".(! empty($remise_percent)? $remise_percent:"null");
|
||||||
|
//$sql.= ", '".price2num($pu_ht)."'";
|
||||||
|
$sql.= ", null";
|
||||||
|
$sql.= ", '".price2num($total_ht)."'";
|
||||||
|
$sql.= ", '".price2num($total_tva)."'";
|
||||||
|
$sql.= ", '".price2num($total_ttc)."'";
|
||||||
|
$sql.= ", ".(int) $rang;
|
||||||
|
//$sql.= ", ".$special_code;
|
||||||
|
$sql.= ", ".(! empty($fk_unit) ? $fk_unit :"null");
|
||||||
|
$sql.= ")";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::addline", LOG_DEBUG);
|
||||||
|
if ($this->db->query($sql)) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
/**
|
||||||
|
* Rend la fichinter automatique
|
||||||
|
*
|
||||||
|
* @param User $user User object
|
||||||
|
* @param int $freq Freq
|
||||||
|
* @param string $courant Courant
|
||||||
|
* @return int 0 if OK, <0 if KO
|
||||||
|
*/
|
||||||
|
public function set_auto($user, $freq, $courant)
|
||||||
|
{
|
||||||
|
// phpcs:enable
|
||||||
|
if ($user->rights->fichinter->creer) {
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter_rec ";
|
||||||
|
$sql .= " SET frequency='".$this->db->escape($freq)."'";
|
||||||
|
$sql .= ", last_gen='".$this->db->escape($courant)."'";
|
||||||
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
|
if ($resql) {
|
||||||
|
$this->frequency = $freq;
|
||||||
|
$this->last_gen = $courant;
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return clicable name (with picto eventually)
|
||||||
|
*
|
||||||
|
* @param int $withpicto Add picto into link
|
||||||
|
* @param string $option Where point the link
|
||||||
|
* @param int $max Maxlength of ref
|
||||||
|
* @param int $short 1=Return just URL
|
||||||
|
* @param string $moretitle Add more text to title tooltip
|
||||||
|
* @return string String with URL
|
||||||
|
*/
|
||||||
|
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '')
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$result='';
|
||||||
|
$label=$langs->trans("ShowInterventionModel").': '.$this->ref;
|
||||||
|
|
||||||
|
$url = DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$this->id;
|
||||||
|
|
||||||
|
if ($short) return $url;
|
||||||
|
|
||||||
|
$picto='intervention';
|
||||||
|
|
||||||
|
$link = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||||
|
$linkend='</a>';
|
||||||
|
|
||||||
|
if ($withpicto) {
|
||||||
|
$result.= $link.img_object($label, $picto, 'class="classfortooltip"').$linkend;
|
||||||
|
}
|
||||||
|
if ($withpicto && $withpicto != 2) {
|
||||||
|
$result.=' ';
|
||||||
|
}
|
||||||
|
if ($withpicto != 2) {
|
||||||
|
$result.=$link.$this->ref.$linkend;
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise an instance with random values.
|
||||||
|
* Used to build previews or test instances.
|
||||||
|
* id must be 0 if object instance is a specimen.
|
||||||
|
*
|
||||||
|
* @param string $option ''=Create a specimen fichinter with lines, 'nolines'=No lines
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function initAsSpecimen($option = '')
|
||||||
|
{
|
||||||
|
global $user, $langs, $conf;
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
$arraynow=dol_getdate($now);
|
||||||
|
$nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']);
|
||||||
|
|
||||||
|
parent::initAsSpecimen($option);
|
||||||
|
|
||||||
|
$this->usenewprice = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function used to replace a thirdparty id with another one.
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param int $origin_id Old thirdparty id
|
||||||
|
* @param int $dest_id New thirdparty id
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
|
||||||
|
{
|
||||||
|
$tables = array( 'fichinter_rec' );
|
||||||
|
|
||||||
|
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update frequency and unit
|
||||||
|
*
|
||||||
|
* @param int $frequency value of frequency
|
||||||
|
* @param string $unit unit of frequency (d, m, y)
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function setFrequencyAndUnit($frequency, $unit)
|
||||||
|
{
|
||||||
|
if (! $this->table_element) {
|
||||||
|
dol_syslog(get_class($this)."::setFrequencyAndUnit called with table_element not defined", LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($frequency) && empty($unit)) {
|
||||||
|
dol_syslog(get_class($this)."::setFrequencyAndUnit called with frequency defined but unit not ", LOG_ERR);
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
|
$sql.= ' SET frequency = '.($frequency?$this->db->escape($frequency):'null');
|
||||||
|
if (!empty($unit)) {
|
||||||
|
$sql.= ', unit_frequency = "'.$this->db->escape($unit).'"';
|
||||||
|
}
|
||||||
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::setFrequencyAndUnit", LOG_DEBUG);
|
||||||
|
if ($this->db->query($sql)) {
|
||||||
|
$this->frequency = $frequency;
|
||||||
|
if (!empty($unit)) $this->unit_frequency = $unit;
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the next date of execution
|
||||||
|
*
|
||||||
|
* @param datetime $date date of execution
|
||||||
|
* @param int $increment_nb_gen_done 0 do nothing more, >0 increment nb_gen_done
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function setNextDate($date, $increment_nb_gen_done = 0)
|
||||||
|
{
|
||||||
|
if (! $this->table_element) {
|
||||||
|
dol_syslog(get_class($this)."::setNextDate was called on objet with property table_element not defined", LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
|
$sql.= " SET date_when = ".($date ? "'".$this->db->idate($date)."'" : "null");
|
||||||
|
if ($increment_nb_gen_done>0) $sql.= ', nb_gen_done = nb_gen_done + 1';
|
||||||
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::setNextDate", LOG_DEBUG);
|
||||||
|
if ($this->db->query($sql)) {
|
||||||
|
$this->date_when = $date;
|
||||||
|
if ($increment_nb_gen_done>0) $this->nb_gen_done++;
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the maximum period
|
||||||
|
*
|
||||||
|
* @param int $nb number of maximum period
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function setMaxPeriod($nb)
|
||||||
|
{
|
||||||
|
if (! $this->table_element) {
|
||||||
|
dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined", LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($nb)) $nb=0;
|
||||||
|
|
||||||
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
|
$sql.= ' SET nb_gen_max = '.$nb;
|
||||||
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::setMaxPeriod", LOG_DEBUG);
|
||||||
|
if ($this->db->query($sql)) {
|
||||||
|
$this->nb_gen_max = $nb;
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the auto validate fichinter
|
||||||
|
*
|
||||||
|
* @param int $validate 0 to create in draft, 1 to create and validate fichinter
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function setAutoValidate($validate)
|
||||||
|
{
|
||||||
|
if (! $this->table_element) {
|
||||||
|
dol_syslog(get_class($this)."::setAutoValidate called with property table_element not defined", LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
|
$sql.= ' SET auto_validate = '.$validate;
|
||||||
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::setAutoValidate", LOG_DEBUG);
|
||||||
|
if ($this->db->query($sql)) {
|
||||||
|
$this->auto_validate = $validate;
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the Number of Generation Done
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
public function updateNbGenDone()
|
||||||
|
{
|
||||||
|
if (! $this->table_element) {
|
||||||
|
dol_syslog(get_class($this)."::updateNbGenDone called with property table_element not defined", LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
|
$sql.= ' SET nb_gen_done = nb_gen_done + 1';
|
||||||
|
$sql.= ' , date_last_gen = now()';
|
||||||
|
// si on et arrivé à la fin des génération
|
||||||
|
if ($this->nb_gen_max == $this->nb_gen_done+1)
|
||||||
|
$sql.= ' , statut = 1';
|
||||||
|
|
||||||
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::setAutoValidate", LOG_DEBUG);
|
||||||
|
if ($this->db->query($sql)) {
|
||||||
|
$this->nb_gen_done = $this->nb_gen_done+1;
|
||||||
|
$this->nb_gen_done = dol_now();
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -54,7 +54,7 @@ $commandestatic = new CommandeFournisseur($db);
|
|||||||
$userstatic=new User($db);
|
$userstatic=new User($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("SuppliersOrdersArea"));
|
print load_fiche_titre($langs->trans("SuppliersOrdersArea"), '', 'commercial');
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|||||||
@ -484,7 +484,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail="SendBillRef";
|
$topicmail="SendBillRef";
|
||||||
$modelmail="invoice_supplier_send";
|
$modelmail="invoice_supplier_send";
|
||||||
|
|||||||
@ -873,7 +873,7 @@ if (empty($action) || $action == 'list')
|
|||||||
|
|
||||||
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
||||||
|
|
||||||
print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
|
print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
|||||||
@ -91,7 +91,7 @@ $titre=($year?$langs->trans("PaymentsReportsForYear", $year):$langs->trans("Paym
|
|||||||
|
|
||||||
llxHeader('', $titre);
|
llxHeader('', $titre);
|
||||||
|
|
||||||
print load_fiche_titre($titre, '', 'title_accountancy.png');
|
print load_fiche_titre($titre, '', 'invoicing');
|
||||||
|
|
||||||
// Formulaire de generation
|
// Formulaire de generation
|
||||||
print '<form method="post" action="rapport.php?year='.$year.'">';
|
print '<form method="post" action="rapport.php?year='.$year.'">';
|
||||||
|
|||||||
@ -48,17 +48,15 @@ $result = restrictedArea($user, 'holiday', $id, '');
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
$formother = new FormOther($db);
|
||||||
$holidaystatic = new Holiday($db);
|
$holidaystatic = new Holiday($db);
|
||||||
|
|
||||||
$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon"));
|
$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon"));
|
||||||
|
|
||||||
|
|
||||||
llxHeader('', $langs->trans('CPTitreMenu'));
|
llxHeader('', $langs->trans('CPTitreMenu'));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans('MenuReportMonth'));
|
print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm');
|
||||||
|
|
||||||
$html = new Form($db);
|
|
||||||
$formother = new FormOther($db);
|
|
||||||
|
|
||||||
|
|
||||||
// Selection filter
|
// Selection filter
|
||||||
|
|||||||
@ -141,7 +141,7 @@ if (! empty($conf->holiday->enabled))
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>';
|
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>';
|
||||||
print "<tr ".$bc[0].">";
|
print '<tr class="oddeven">';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
|
|
||||||
$out='';
|
$out='';
|
||||||
@ -197,8 +197,8 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("BoxTitleLastLeaveRequests", min($max, $num)).'</th>';
|
print '<th colspan="3">'.$langs->trans("BoxTitleLastLeaveRequests", min($max, $num)).'</th>';
|
||||||
print '<th>'.$langs->trans("from").'</th>';
|
print '<th>'.$langs->trans("from").'</th>';
|
||||||
@ -244,7 +244,8 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
|
|||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table></div><br>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -272,8 +273,8 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="2">'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).'</th>';
|
print '<th colspan="2">'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).'</th>';
|
||||||
print '<th class="right">'.$langs->trans("FeesKilometersOrAmout").'</th>';
|
print '<th class="right">'.$langs->trans("FeesKilometersOrAmout").'</th>';
|
||||||
@ -344,8 +345,8 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="2">'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).'</th>';
|
print '<th colspan="2">'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).'</th>';
|
||||||
print '<th class="right">'.$langs->trans("TotalTTC").'</th>';
|
print '<th class="right">'.$langs->trans("TotalTTC").'</th>';
|
||||||
|
|||||||
@ -141,6 +141,11 @@ ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_socpeople
|
|||||||
|
|
||||||
ALTER TABLE llx_accounting_account MODIFY COLUMN rowid bigint AUTO_INCREMENT;
|
ALTER TABLE llx_accounting_account MODIFY COLUMN rowid bigint AUTO_INCREMENT;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL;
|
||||||
|
ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
create table llx_c_hrm_public_holiday
|
create table llx_c_hrm_public_holiday
|
||||||
(
|
(
|
||||||
id integer AUTO_INCREMENT PRIMARY KEY,
|
id integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
@ -208,5 +213,77 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m
|
|||||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1);
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1);
|
||||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1);
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1);
|
||||||
|
|
||||||
|
create table llx_fichinter_rec
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
titre varchar(50) NOT NULL,
|
||||||
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
|
fk_soc integer DEFAULT NULL,
|
||||||
|
datec datetime, -- date de creation
|
||||||
|
fk_contrat integer DEFAULT 0, -- contrat auquel est rattache la fiche
|
||||||
|
fk_user_author integer, -- createur
|
||||||
|
fk_projet integer, -- projet auquel est associe la facture
|
||||||
|
duree real, -- duree totale de l'intervention
|
||||||
|
description text,
|
||||||
|
modelpdf varchar(50),
|
||||||
|
note_private text,
|
||||||
|
note_public text,
|
||||||
|
frequency integer, -- frequency (for example: 3 for every 3 month)
|
||||||
|
unit_frequency varchar(2) DEFAULT 'm', -- 'm' for month (date_when must be a day <= 28), 'y' for year, ...
|
||||||
|
date_when datetime DEFAULT NULL, -- date for next gen (when an invoice is generated, this field must be updated with next date)
|
||||||
|
date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice)
|
||||||
|
nb_gen_done integer DEFAULT NULL, -- nb of generation done (when an invoice is generated, this field must incremented)
|
||||||
|
nb_gen_max integer DEFAULT NULL, -- maximum number of generation
|
||||||
|
auto_validate integer NULL DEFAULT NULL -- statut of the generated intervention
|
||||||
|
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
ALTER TABLE llx_fichinter_rec ADD UNIQUE INDEX idx_fichinter_rec_uk_titre (titre, entity);
|
||||||
|
ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_soc (fk_soc);
|
||||||
|
ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_user_author (fk_user_author);
|
||||||
|
ALTER TABLE llx_fichinter_rec ADD INDEX idx_fichinter_rec_fk_projet (fk_projet);
|
||||||
|
ALTER TABLE llx_fichinter_rec ADD CONSTRAINT fk_fichinter_rec_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||||
|
ALTER TABLE llx_fichinter_rec ADD CONSTRAINT fk_fichinter_rec_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
|
||||||
|
|
||||||
|
create table llx_fichinterdet_rec
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
fk_fichinter integer NOT NULL,
|
||||||
|
date datetime, -- date de la ligne d'intervention
|
||||||
|
description text, -- description de la ligne d'intervention
|
||||||
|
duree integer, -- duree de la ligne d'intervention
|
||||||
|
rang integer DEFAULT 0, -- ordre affichage sur la fiche
|
||||||
|
total_ht DOUBLE(24, 8) NULL DEFAULT NULL,
|
||||||
|
subprice DOUBLE(24, 8) NULL DEFAULT NULL,
|
||||||
|
fk_parent_line integer NULL DEFAULT NULL,
|
||||||
|
fk_product integer NULL DEFAULT NULL,
|
||||||
|
label varchar(255) NULL DEFAULT NULL,
|
||||||
|
tva_tx DOUBLE(6, 3) NULL DEFAULT NULL,
|
||||||
|
localtax1_tx DOUBLE(6, 3) NULL DEFAULT 0,
|
||||||
|
localtax1_type VARCHAR(1) NULL DEFAULT NULL,
|
||||||
|
localtax2_tx DOUBLE(6, 3) NULL DEFAULT 0,
|
||||||
|
localtax2_type VARCHAR(1) NULL DEFAULT NULL,
|
||||||
|
qty double NULL DEFAULT NULL,
|
||||||
|
remise_percent double NULL DEFAULT 0,
|
||||||
|
remise double NULL DEFAULT 0,
|
||||||
|
fk_remise_except integer NULL DEFAULT NULL,
|
||||||
|
price DOUBLE(24, 8) NULL DEFAULT NULL,
|
||||||
|
total_tva DOUBLE(24, 8) NULL DEFAULT NULL,
|
||||||
|
total_localtax1 DOUBLE(24, 8) NULL DEFAULT 0,
|
||||||
|
total_localtax2 DOUBLE(24, 8) NULL DEFAULT 0,
|
||||||
|
total_ttc DOUBLE(24, 8) NULL DEFAULT NULL,
|
||||||
|
product_type INTEGER NULL DEFAULT 0,
|
||||||
|
date_start datetime NULL DEFAULT NULL,
|
||||||
|
date_end datetime NULL DEFAULT NULL,
|
||||||
|
info_bits INTEGER NULL DEFAULT 0,
|
||||||
|
buy_price_ht DOUBLE(24, 8) NULL DEFAULT 0,
|
||||||
|
fk_product_fournisseur_price integer NULL DEFAULT NULL,
|
||||||
|
fk_code_ventilation integer NOT NULL DEFAULT 0,
|
||||||
|
fk_export_commpta integer NOT NULL DEFAULT 0,
|
||||||
|
special_code integer UNSIGNED NULL DEFAULT 0,
|
||||||
|
fk_unit integer NULL DEFAULT NULL,
|
||||||
|
import_key varchar(14) NULL DEFAULT NULL
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL AFTER product_type;
|
ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL AFTER product_type;
|
||||||
ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL AFTER date_start;
|
ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL AFTER date_start;
|
||||||
|
|||||||
@ -1586,6 +1586,7 @@ FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines fo
|
|||||||
FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing)
|
FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing)
|
||||||
FCKeditorForUserSignature=WYSIWIG creation/edition of user signature
|
FCKeditorForUserSignature=WYSIWIG creation/edition of user signature
|
||||||
FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing)
|
FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing)
|
||||||
|
FCKeditorForTicket=WYSIWIG creation/edition for tickets
|
||||||
##### Stock #####
|
##### Stock #####
|
||||||
StockSetup=Stock module setup
|
StockSetup=Stock module setup
|
||||||
IfYouUsePointOfSaleCheckModule=If you use the Point of Sale module (POS) provided by default or an external module, this setup may be ignored by your POS module. Most POS modules are designed by default to create an invoice immediately and decrease stock irrespective of the options here. So if you need or not to have a stock decrease when registering a sale from your POS, check also your POS module setup.
|
IfYouUsePointOfSaleCheckModule=If you use the Point of Sale module (POS) provided by default or an external module, this setup may be ignored by your POS module. Most POS modules are designed by default to create an invoice immediately and decrease stock irrespective of the options here. So if you need or not to have a stock decrease when registering a sale from your POS, check also your POS module setup.
|
||||||
|
|||||||
@ -18,3 +18,4 @@ SetHereATitleForLink=Set a name for the bookmark
|
|||||||
UseAnExternalHttpLinkOrRelativeDolibarrLink=Use an external/absolute link (https://URL) or an internal/relative link (/DOLIBARR_ROOT/htdocs/...)
|
UseAnExternalHttpLinkOrRelativeDolibarrLink=Use an external/absolute link (https://URL) or an internal/relative link (/DOLIBARR_ROOT/htdocs/...)
|
||||||
ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choose if the linked page should open in the current tab or a new tab
|
ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choose if the linked page should open in the current tab or a new tab
|
||||||
BookmarksManagement=Bookmarks management
|
BookmarksManagement=Bookmarks management
|
||||||
|
BookmarksMenuShortCut=Ctrl + shift + m
|
||||||
|
|||||||
@ -90,3 +90,4 @@ ShowCategory=Show tag/category
|
|||||||
ByDefaultInList=By default in list
|
ByDefaultInList=By default in list
|
||||||
ChooseCategory=Choose category
|
ChooseCategory=Choose category
|
||||||
StocksCategoriesArea=Warehouses Categories Area
|
StocksCategoriesArea=Warehouses Categories Area
|
||||||
|
UseOrOperatorForCategories=Use or operator for categories
|
||||||
@ -52,6 +52,9 @@ MemberStatusResiliated=Terminated member
|
|||||||
MemberStatusResiliatedShort=Terminated
|
MemberStatusResiliatedShort=Terminated
|
||||||
MembersStatusToValid=Draft members
|
MembersStatusToValid=Draft members
|
||||||
MembersStatusResiliated=Terminated members
|
MembersStatusResiliated=Terminated members
|
||||||
|
MemberStatusNoSubscription=Validated (no subscription needed)
|
||||||
|
MemberStatusNoSubscriptionShort=Validated
|
||||||
|
SubscriptionNotNeeded=No subscription needed
|
||||||
NewCotisation=New contribution
|
NewCotisation=New contribution
|
||||||
PaymentSubscription=New contribution payment
|
PaymentSubscription=New contribution payment
|
||||||
SubscriptionEndDate=Subscription's end date
|
SubscriptionEndDate=Subscription's end date
|
||||||
|
|||||||
@ -1586,6 +1586,7 @@ FCKeditorForProductDetails=Création/édition WYSIWIG des lignes détails produi
|
|||||||
FCKeditorForMailing= Création/édition WYSIWIG des emailings (Outils->Emailings)
|
FCKeditorForMailing= Création/édition WYSIWIG des emailings (Outils->Emailings)
|
||||||
FCKeditorForUserSignature=Création/édition WYSIWIG de la signature des utilisateurs
|
FCKeditorForUserSignature=Création/édition WYSIWIG de la signature des utilisateurs
|
||||||
FCKeditorForMail=Création/édition WYSIWIG tous les emails (sauf Outils->Emailings)
|
FCKeditorForMail=Création/édition WYSIWIG tous les emails (sauf Outils->Emailings)
|
||||||
|
FCKeditorForTicket=Création/édition WYSIWIG pour les tickets
|
||||||
##### Stock #####
|
##### Stock #####
|
||||||
StockSetup=Configuration du module Stock / Entrepôt
|
StockSetup=Configuration du module Stock / Entrepôt
|
||||||
IfYouUsePointOfSaleCheckModule=Si vous utilisez un module Point de Vente (module POS fourni par défaut ou un autre module externe), cette configuration peut être ignoré par votre module point de vente. La plupart de modules Point de Vente sont conçus pour créer immédiatement une facture et de réduire les stocks par défaut quelles que soient les options ici. Donc, si vous avez besoin ou non d'avoir une diminution du stock lors de l'enregistrement d'une vente dans votre Point de Vente, vérifiez également la configuration de votre module POS.
|
IfYouUsePointOfSaleCheckModule=Si vous utilisez un module Point de Vente (module POS fourni par défaut ou un autre module externe), cette configuration peut être ignoré par votre module point de vente. La plupart de modules Point de Vente sont conçus pour créer immédiatement une facture et de réduire les stocks par défaut quelles que soient les options ici. Donc, si vous avez besoin ou non d'avoir une diminution du stock lors de l'enregistrement d'une vente dans votre Point de Vente, vérifiez également la configuration de votre module POS.
|
||||||
|
|||||||
@ -52,6 +52,9 @@ MemberStatusResiliated=Adhérent résilié
|
|||||||
MemberStatusResiliatedShort=Résilié
|
MemberStatusResiliatedShort=Résilié
|
||||||
MembersStatusToValid=Adhérents brouillons
|
MembersStatusToValid=Adhérents brouillons
|
||||||
MembersStatusResiliated=Adhérents résiliés
|
MembersStatusResiliated=Adhérents résiliés
|
||||||
|
MemberStatusNoSubscription=Validé (pas de souscription requise)
|
||||||
|
MemberStatusNoSubscriptionShort=Validé
|
||||||
|
SubscriptionNotNeeded=Pas de souscription requise
|
||||||
NewCotisation=Nouvelle adhésion
|
NewCotisation=Nouvelle adhésion
|
||||||
PaymentSubscription=Paiement cotisation
|
PaymentSubscription=Paiement cotisation
|
||||||
SubscriptionEndDate=Date de fin adhésion
|
SubscriptionEndDate=Date de fin adhésion
|
||||||
|
|||||||
@ -1284,13 +1284,9 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
|||||||
if (! defined('DISABLE_FONT_AWSOME'))
|
if (! defined('DISABLE_FONT_AWSOME'))
|
||||||
{
|
{
|
||||||
print '<!-- Includes CSS for font awesome -->'."\n";
|
print '<!-- Includes CSS for font awesome -->'."\n";
|
||||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/fontawesome/css/font-awesome.min.css'.($ext?'?'.$ext:'').'">'."\n";
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5))
|
|
||||||
{
|
|
||||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/fontawesome-5/css/all.min.css'.($ext?'?'.$ext:'').'">'."\n";
|
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/fontawesome-5/css/all.min.css'.($ext?'?'.$ext:'').'">'."\n";
|
||||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/fontawesome-5/css/v4-shims.min.css'.($ext?'?'.$ext:'').'">'."\n";
|
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/fontawesome-5/css/v4-shims.min.css'.($ext?'?'.$ext:'').'">'."\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
print '<!-- Includes CSS for Dolibarr theme -->'."\n";
|
print '<!-- Includes CSS for Dolibarr theme -->'."\n";
|
||||||
// Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php'
|
// Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php'
|
||||||
@ -1606,6 +1602,10 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||||||
|
|
||||||
print '<div class="login_block usedropdown">'."\n";
|
print '<div class="login_block usedropdown">'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Add login user link
|
// Add login user link
|
||||||
$toprightmenu.='<div class="login_block_user">';
|
$toprightmenu.='<div class="login_block_user">';
|
||||||
|
|
||||||
@ -1613,6 +1613,17 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
|||||||
$mode=-1;
|
$mode=-1;
|
||||||
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
|
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
|
||||||
|
|
||||||
|
if(!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)){
|
||||||
|
// Add search dropdown
|
||||||
|
$toprightmenu.= top_menu_search($user, $langs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!empty($conf->global->MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN)) {
|
||||||
|
// Add bookmark dropdown
|
||||||
|
$toprightmenu .= top_menu_bookmark($user, $langs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// add user dropdown
|
||||||
$toprightmenu.= top_menu_user($user, $langs);
|
$toprightmenu.= top_menu_user($user, $langs);
|
||||||
|
|
||||||
$toprightmenu.='</div></div>';
|
$toprightmenu.='</div></div>';
|
||||||
@ -1827,12 +1838,10 @@ function top_menu_user(User $user, Translate $langs)
|
|||||||
else $appli.=" ".DOL_VERSION;
|
else $appli.=" ".DOL_VERSION;
|
||||||
|
|
||||||
$btnUser = '<!-- div for user link -->
|
$btnUser = '<!-- div for user link -->
|
||||||
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu">
|
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
|
||||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a" data-toggle="dropdown">
|
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a" data-toggle="dropdown">
|
||||||
'.$userImage.'
|
'.$userImage.'
|
||||||
<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>
|
<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>
|
||||||
<span class="fa fa-chevron-down login-dropdown-btn" id="dropdown-icon-down"></span>
|
|
||||||
<span class="fa fa-chevron-up login-dropdown-btn hidden" id="dropdown-icon-up"></span>
|
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<!-- User image -->
|
<!-- User image -->
|
||||||
@ -1873,16 +1882,12 @@ function top_menu_user(User $user, Translate $langs)
|
|||||||
if (!$(event.target).closest("#topmenu-login-dropdown").length) {
|
if (!$(event.target).closest("#topmenu-login-dropdown").length) {
|
||||||
// Hide the menus.
|
// Hide the menus.
|
||||||
$("#topmenu-login-dropdown").removeClass("open");
|
$("#topmenu-login-dropdown").removeClass("open");
|
||||||
$("#dropdown-icon-down").show(); // use show/hide instead toggle for avoid conflict
|
|
||||||
$("#dropdown-icon-up").hide(); // use show/hide instead toggle for avoid conflict
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
|
$("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$("#topmenu-login-dropdown").toggleClass("open");
|
$("#topmenu-login-dropdown").toggleClass("open");
|
||||||
$("#dropdown-icon-down").toggle();
|
|
||||||
$("#dropdown-icon-up").toggle();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#topmenuloginmoreinfo-btn").on("click", function() {
|
$("#topmenuloginmoreinfo-btn").on("click", function() {
|
||||||
@ -1897,6 +1902,203 @@ function top_menu_user(User $user, Translate $langs)
|
|||||||
return $btnUser;
|
return $btnUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the tooltip on top menu bookmark
|
||||||
|
*
|
||||||
|
* @param user $user User object
|
||||||
|
* @param Translate $langs Language object
|
||||||
|
* @return string HTML content
|
||||||
|
*/
|
||||||
|
function top_menu_bookmark(User $user, Translate $langs)
|
||||||
|
{
|
||||||
|
global $langs, $conf, $db, $hookmanager, $user;
|
||||||
|
global $menumanager;
|
||||||
|
$html = '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Define $bookmarks
|
||||||
|
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
|
||||||
|
$langs->load("bookmarks");
|
||||||
|
|
||||||
|
$html.= '<!-- div for bookmark link -->
|
||||||
|
<div id="topmenu-bookmark-dropdown" class="atoplogin dropdown inline-block">
|
||||||
|
<a class="dropdown-toggle login-dropdown-a" data-toggle="dropdown" href="#" title="'.$langs->trans('Bookmarks').' ('.$langs->trans('BookmarksMenuShortCut').')">
|
||||||
|
<i class="fa fa-star" ></i>
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
'.printDropdownBookmarksList($db, $langs).'
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$html .= '
|
||||||
|
<!-- Code to show/hide the user drop-down -->
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
$(document).on("click", function(event) {
|
||||||
|
if (!$(event.target).closest("#topmenu-bookmark-dropdown").length) {
|
||||||
|
// Hide the menus.
|
||||||
|
$("#topmenu-bookmark-dropdown").removeClass("open");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#topmenu-bookmark-dropdown .dropdown-toggle").on("click", function(event) {
|
||||||
|
openBookMarkDropDown();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Key map shortcut
|
||||||
|
$(document).keydown(function(e){
|
||||||
|
if( e.which === 77 && e.ctrlKey && e.shiftKey ){
|
||||||
|
console.log(\'control + shift + m : trigger open bookmark dropdown\');
|
||||||
|
openBookMarkDropDown();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var openBookMarkDropDown = function() {
|
||||||
|
event.preventDefault();
|
||||||
|
$("#topmenu-bookmark-dropdown").toggleClass("open");
|
||||||
|
$("#top-bookmark-search-input").focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
';
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the tooltip on top menu tsearch
|
||||||
|
*
|
||||||
|
* @param user $user User object
|
||||||
|
* @param Translate $langs Language object
|
||||||
|
* @return string HTML content
|
||||||
|
*/
|
||||||
|
function top_menu_search(User $user, Translate $langs)
|
||||||
|
{
|
||||||
|
global $langs, $conf, $db, $hookmanager, $user;
|
||||||
|
global $menumanager;
|
||||||
|
$html = '';
|
||||||
|
|
||||||
|
$usedbyinclude=1;
|
||||||
|
$arrayresult=null;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; // This set $arrayresult
|
||||||
|
|
||||||
|
$defaultAction = '';
|
||||||
|
$buttonList='<div class="dropdown-global-search-button-list" >';
|
||||||
|
// Menu with all bookmarks
|
||||||
|
foreach ($arrayresult as $keyItem => $item)
|
||||||
|
{
|
||||||
|
if(empty($defaultAction)){
|
||||||
|
$defaultAction= $item['url'];
|
||||||
|
}
|
||||||
|
$buttonList.='<button class="dropdown-item global-search-item" data-target="'.dol_escape_htmltag($item['url']).'" >';
|
||||||
|
$buttonList.= $item['text'];
|
||||||
|
$buttonList.='</button>';
|
||||||
|
}
|
||||||
|
$buttonList.='</div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$searchInput = '<input name="sall" id="top-global-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Search').'" autocomplete="off" >';
|
||||||
|
|
||||||
|
|
||||||
|
$dropDownHtml = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
||||||
|
$dropDownHtml.= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="'.$defaultAction.'" >';
|
||||||
|
|
||||||
|
$dropDownHtml.= '
|
||||||
|
<!-- search input -->
|
||||||
|
<div class="dropdown-header search-dropdown-header">
|
||||||
|
' . $searchInput . '
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$dropDownHtml.= '
|
||||||
|
<!-- Menu Body -->
|
||||||
|
<div class="dropdown-body search-dropdown-body">
|
||||||
|
'.$buttonList.'
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$dropDownHtml.= '</form>';
|
||||||
|
|
||||||
|
|
||||||
|
$html.= '<!-- div for Global Search -->
|
||||||
|
<div id="topmenu-global-search-dropdown" class="atoplogin dropdown inline-block">
|
||||||
|
<a class="dropdown-toggle login-dropdown-a" data-toggle="dropdown" href="#" title="'.$langs->trans('Search').' ('.$langs->trans('SearchMenuShortCut').')">
|
||||||
|
<i class="fa fa-search" ></i>
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
'.$dropDownHtml.'
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
$html .= '
|
||||||
|
<!-- Code to show/hide the user drop-down -->
|
||||||
|
<script>
|
||||||
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
// prevent submiting form on press ENTER
|
||||||
|
$("#top-global-search-input").keydown(function (e) {
|
||||||
|
if (e.keyCode == 13) {
|
||||||
|
var inputs = $(this).parents("form").eq(0).find(":button");
|
||||||
|
if (inputs[inputs.index(this) + 1] != null) {
|
||||||
|
inputs[inputs.index(this) + 1].focus();
|
||||||
|
}
|
||||||
|
e.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// submit form action
|
||||||
|
$(".dropdown-global-search-button-list .global-search-item").on("click", function(event) {
|
||||||
|
$("#top-menu-action-bookmark").attr("action", $(this).data("target"));
|
||||||
|
$("#top-menu-action-bookmark").submit();
|
||||||
|
});
|
||||||
|
|
||||||
|
// close drop down
|
||||||
|
$(document).on("click", function(event) {
|
||||||
|
if (!$(event.target).closest("#topmenu-global-search-dropdown").length) {
|
||||||
|
// Hide the menus.
|
||||||
|
$("#topmenu-global-search-dropdown").removeClass("open");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Open drop down
|
||||||
|
$("#topmenu-global-search-dropdown .dropdown-toggle").on("click", function(event) {
|
||||||
|
openGlobalSearchDropDown();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Key map shortcut
|
||||||
|
$(document).keydown(function(e){
|
||||||
|
if( e.which === 70 && e.ctrlKey && e.shiftKey ){
|
||||||
|
console.log(\'control + shift + f : trigger open global-search dropdown\');
|
||||||
|
openGlobalSearchDropDown();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var openGlobalSearchDropDown = function() {
|
||||||
|
event.preventDefault();
|
||||||
|
$("#topmenu-global-search-dropdown").toggleClass("open");
|
||||||
|
$("#top-global-search-input").focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show left menu bar
|
* Show left menu bar
|
||||||
*
|
*
|
||||||
@ -1934,55 +2136,47 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
|||||||
|
|
||||||
if (! is_object($form)) $form=new Form($db);
|
if (! is_object($form)) $form=new Form($db);
|
||||||
$selected=-1;
|
$selected=-1;
|
||||||
$usedbyinclude=1;
|
if(empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) {
|
||||||
$arrayresult=null;
|
$usedbyinclude = 1;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; // This set $arrayresult
|
$arrayresult = null;
|
||||||
|
include DOL_DOCUMENT_ROOT . '/core/ajax/selectsearchbox.php'; // This set $arrayresult
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM))
|
if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
|
||||||
{
|
$searchform .= $form->selectArrayFilter('searchselectcombo', $arrayresult, $selected, '', 1, 0, (empty($conf->global->MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY) ? 1 : 0), 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1);
|
||||||
$searchform.=$form->selectArrayFilter('searchselectcombo', $arrayresult, $selected, '', 1, 0, (empty($conf->global->MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY)?1:0), 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1);
|
} else {
|
||||||
}
|
if (is_array($arrayresult)) {
|
||||||
else
|
foreach ($arrayresult as $key => $val) {
|
||||||
{
|
$searchform .= printSearchForm($val['url'], $val['url'], $val['label'], 'maxwidth125', 'sall', $val['shortcut'], 'searchleft' . $key, img_picto('', $val['img'], '', false, 1, 1));
|
||||||
if (is_array($arrayresult))
|
|
||||||
{
|
|
||||||
foreach($arrayresult as $key => $val)
|
|
||||||
{
|
|
||||||
$searchform.=printSearchForm($val['url'], $val['url'], $val['label'], 'maxwidth125', 'sall', $val['shortcut'], 'searchleft'.$key, img_picto('', $val['img'], '', false, 1, 1));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook printSearchForm
|
// Execute hook printSearchForm
|
||||||
$parameters=array('searchform'=>$searchform);
|
$parameters = array('searchform' => $searchform);
|
||||||
$reshook=$hookmanager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
$searchform .= $hookmanager->resPrint;
|
||||||
$searchform.=$hookmanager->resPrint;
|
} else $searchform = $hookmanager->resPrint;
|
||||||
}
|
|
||||||
else $searchform=$hookmanager->resPrint;
|
|
||||||
|
|
||||||
// Force special value for $searchform
|
// Force special value for $searchform
|
||||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty($conf->use_javascript_ajax))
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty($conf->use_javascript_ajax)) {
|
||||||
{
|
$urltosearch = DOL_URL_ROOT . '/core/search_page.php?showtitlebefore=1';
|
||||||
$urltosearch=DOL_URL_ROOT.'/core/search_page.php?showtitlebefore=1';
|
$searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="' . $urltosearch . '" accesskey="s" alt="' . dol_escape_htmltag($langs->trans("ShowSearchFields")) . '">' . $langs->trans("Search") . '...</a></div></div>';
|
||||||
$searchform='<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" accesskey="s" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div></div>';
|
} elseif ($conf->use_javascript_ajax && !empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
|
||||||
}
|
$searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="' . dol_escape_htmltag($langs->trans("ShowSearchFields")) . '">' . $langs->trans("Search") . '...</a></div><div id="divsearchforms2" style="display: none">' . $searchform . '</div>';
|
||||||
elseif ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_USE_OLD_SEARCH_FORM))
|
$searchform .= '<script>
|
||||||
{
|
|
||||||
$searchform='<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div><div id="divsearchforms2" style="display: none">'.$searchform.'</div>';
|
|
||||||
$searchform.='<script>
|
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
jQuery("#divsearchforms1").click(function(){
|
jQuery("#divsearchforms1").click(function(){
|
||||||
jQuery("#divsearchforms2").toggle();
|
jQuery("#divsearchforms2").toggle();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>' . "\n";
|
</script>' . "\n";
|
||||||
$searchform.='</div>';
|
$searchform .= '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define $bookmarks
|
// Define $bookmarks
|
||||||
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
|
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire && empty($conf->global->MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN))
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
|
||||||
$langs->load("bookmarks");
|
$langs->load("bookmarks");
|
||||||
|
|||||||
@ -413,7 +413,7 @@ foreach($object->fields as $key => $val)
|
|||||||
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
elseif (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
elseif (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
elseif (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
elseif (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right';
|
elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield.=($cssforfield?' ':'').'right';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked']))
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'">';
|
print '<td class="liste_titre'.($cssforfield?' '.$cssforfield:'').'">';
|
||||||
@ -446,7 +446,7 @@ foreach($object->fields as $key => $val)
|
|||||||
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
if ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
elseif (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
elseif (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
|
||||||
elseif (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
elseif (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
|
||||||
elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price'))) $cssforfield.=($cssforfield?' ':'').'right';
|
elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield.=($cssforfield?' ':'').'right';
|
||||||
if (! empty($arrayfields['t.'.$key]['checked']))
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
{
|
{
|
||||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n";
|
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n";
|
||||||
|
|||||||
@ -48,7 +48,7 @@ $staticbom = new BOM($db);
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("MRP"), '');
|
llxHeader('', $langs->trans("MRP"), '');
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("MRPArea"));
|
print load_fiche_titre($langs->trans("MRPArea"), '', 'cubes');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|||||||
@ -42,8 +42,6 @@ $hookmanager->initHooks(array('opensurveyindex'));
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$nbsondages=0;
|
$nbsondages=0;
|
||||||
$sql = 'SELECT COUNT(*) as nb';
|
$sql = 'SELECT COUNT(*) as nb';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_sondage';
|
||||||
@ -56,9 +54,11 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
else dol_print_error($db, '');
|
else dol_print_error($db, '');
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("OpenSurveyArea"));
|
$title = $langs->trans("OpenSurveyArea");
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
|
print load_fiche_titre($title, '', 'wrench');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|||||||
@ -31,7 +31,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe
|
|||||||
<!-- BEGIN PHP TEMPLATE -->
|
<!-- BEGIN PHP TEMPLATE -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
print load_fiche_titre($langs->trans("NewProduct"), '', 'title_products.png');
|
print load_fiche_titre($langs->trans("NewProduct"), '', 'products');
|
||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe
|
|||||||
<!-- BEGIN PHP TEMPLATE CREATE.TPL -->
|
<!-- BEGIN PHP TEMPLATE CREATE.TPL -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
print load_fiche_titre($langs->trans("NewService"), '', 'title_products.png');
|
print load_fiche_titre($langs->trans("NewService"), '', 'products');
|
||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -938,7 +938,7 @@ else
|
|||||||
if ($type==1) $title=$langs->trans("NewService");
|
if ($type==1) $title=$langs->trans("NewService");
|
||||||
else $title=$langs->trans("NewProduct");
|
else $title=$langs->trans("NewProduct");
|
||||||
$linkback="";
|
$linkback="";
|
||||||
print load_fiche_titre($title, $linkback, 'title_products.png');
|
print load_fiche_titre($title, $linkback, 'products');
|
||||||
|
|
||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,7 @@ jQuery(document).ready(function() {
|
|||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("NewInventory", $langs->transnoentitiesnoconv("MyInventory")));
|
print load_fiche_titre($langs->trans("NewInventory", $langs->transnoentitiesnoconv("MyInventory")), '', 'products');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|||||||
@ -321,7 +321,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, '', '', $limit);
|
||||||
|
|
||||||
// Add code for pre mass action (confirmation or email presend form)
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
|
|||||||
@ -505,7 +505,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
if (empty($arrayfields['p.fk_product_type']['checked'])) print '<input type="hidden" name="search_type" value="'.dol_escape_htmltag($search_type).'">';
|
if (empty($arrayfields['p.fk_product_type']['checked'])) print '<input type="hidden" name="search_type" value="'.dol_escape_htmltag($search_type).'">';
|
||||||
|
|
||||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_products.png', 0, $newcardbutton, '', $limit);
|
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
$modelmail="product";
|
$modelmail="product";
|
||||||
@ -537,7 +537,7 @@ if ($resql)
|
|||||||
$categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1);
|
$categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1);
|
||||||
$categoriesProductArr[-2] = '- ' . $langs->trans('NotCategorized') . ' -';
|
$categoriesProductArr[-2] = '- ' . $langs->trans('NotCategorized') . ' -';
|
||||||
$moreforfilter.=Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300');
|
$moreforfilter.=Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300');
|
||||||
$moreforfilter.='<input type="checkbox" class="valignmiddle" name="search_category_product_operator" value="1"' . ($searchCategoryProductOperator==1 ? ' checked="checked"' : '') . '/> ' . $langs->trans('or');
|
$moreforfilter.=' <input type="checkbox" class="valignmiddle" name="search_category_product_operator" value="1"' . ($searchCategoryProductOperator==1 ? ' checked="checked"' : '') . '/> ' . $langs->trans('UseOrOperatorForCategories');
|
||||||
$moreforfilter.='</div>';
|
$moreforfilter.='</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ $title=$langs->trans("Statistics");
|
|||||||
|
|
||||||
llxHeader('', $title, $helpurl);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
print load_fiche_titre($title, $mesg, 'title_products.png');
|
print load_fiche_titre($title, $mesg, 'products');
|
||||||
|
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
|
|||||||
@ -218,7 +218,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
|
|
||||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_products', 0, '', '', $limit);
|
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit);
|
||||||
|
|
||||||
if (! empty($catid))
|
if (! empty($catid))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -233,7 +233,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
|
|
||||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_products', 0, '', '', $limit);
|
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit);
|
||||||
|
|
||||||
|
|
||||||
if (! empty($catid))
|
if (! empty($catid))
|
||||||
|
|||||||
@ -103,7 +103,7 @@ if (! $id && empty($ref))
|
|||||||
$title=$langs->trans("Statistics");
|
$title=$langs->trans("Statistics");
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($title, $mesg, 'title_products.png');
|
print load_fiche_titre($title, $mesg, 'products');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -104,15 +104,18 @@ $form=new Form($db);
|
|||||||
$warehouse=new Entrepot($db);
|
$warehouse=new Entrepot($db);
|
||||||
|
|
||||||
$sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,";
|
$sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,";
|
||||||
$sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty,";
|
$sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (! empty($extrafields->attributes[$object->table_element]['label']))
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||||
|
$sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql=preg_replace('/, $/', '', $sql);
|
//$sql=preg_replace('/, $/', '', $sql);
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
|
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid";
|
||||||
|
|||||||
@ -294,7 +294,7 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_products', 0, '', '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'products', 0, '', '', $limit);
|
||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
$modelmail="productlot";
|
$modelmail="productlot";
|
||||||
|
|||||||
@ -85,8 +85,8 @@ $morehtml.='<option name="mine" value="'.$user->id.'"'.(($search_project_user ==
|
|||||||
$morehtml.='</SELECT>';
|
$morehtml.='</SELECT>';
|
||||||
$morehtml.='<input type="submit" class="button" name="refresh" value="'.$langs->trans("Refresh").'">';
|
$morehtml.='<input type="submit" class="button" name="refresh" value="'.$langs->trans("Refresh").'">';
|
||||||
|
|
||||||
print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, -1, 'title_project.png', 0, $morehtml);
|
print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, -1, 'project', 0, $morehtml);
|
||||||
//print load_fiche_titre($title, '', 'title_project');
|
//print load_fiche_titre($title, '', 'project');
|
||||||
|
|
||||||
if ($mine) print $langs->trans("MyTasksDesc").'<br><br>';
|
if ($mine) print $langs->trans("MyTasksDesc").'<br><br>';
|
||||||
else
|
else
|
||||||
|
|||||||
@ -417,7 +417,7 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($proj
|
|||||||
|
|
||||||
llxHeader("", $title, "", '', '', '', array('/core/js/timesheet.js'));
|
llxHeader("", $title, "", '', '', '', array('/core/js/timesheet.js'));
|
||||||
|
|
||||||
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'project');
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
$param.=($mode?'&mode='.urlencode($mode):'');
|
$param.=($mode?'&mode='.urlencode($mode):'');
|
||||||
|
|||||||
@ -435,7 +435,7 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($proj
|
|||||||
|
|
||||||
llxHeader("", $title, "", '', '', '', array('/core/js/timesheet.js'));
|
llxHeader("", $title, "", '', '', '', array('/core/js/timesheet.js'));
|
||||||
|
|
||||||
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
|
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'project');
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
$param.=($mode?'&mode='.urlencode($mode):'');
|
$param.=($mode?'&mode='.urlencode($mode):'');
|
||||||
|
|||||||
@ -498,7 +498,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
$thirdparty=new Societe($db);
|
$thirdparty=new Societe($db);
|
||||||
if ($socid > 0) $thirdparty->fetch($socid);
|
if ($socid > 0) $thirdparty->fetch($socid);
|
||||||
|
|
||||||
print load_fiche_titre($titlenew, '', 'title_project');
|
print load_fiche_titre($titlenew, '', 'project');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|||||||
@ -461,7 +461,7 @@ else
|
|||||||
else $texthelp.=$langs->trans("ProjectsPublicDesc");
|
else $texthelp.=$langs->trans("ProjectsPublicDesc");
|
||||||
}
|
}
|
||||||
|
|
||||||
print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_project', 0, $newcardbutton, '', $limit);
|
print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'project', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user