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

This commit is contained in:
Laurent Destailleur 2016-06-10 18:59:05 +02:00
commit 6034ba658c
128 changed files with 1427 additions and 481 deletions

View File

@ -285,7 +285,7 @@ script:
php upgrade2.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-2.log
php step5.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-3.log
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log
php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API > $TRAVIS_BUILD_DIR/upgrade390400-2.log
php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade390400-2.log
php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log
cd -
set +e

View File

@ -5,4 +5,17 @@ Require all denied
<IfVersion < 2.3>
Order deny, allow
Denied from all
</IfVersion>
</IfVersion>
# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours, A691600 = 8 days = recommanded for static resources).
# Note that you must also enable the module mod_expires.
#ExpiresActive On
#ExpiresByType image/x-icon A2592000
#ExpiresByType image/gif A2592000
#ExpiresByType image/png A2592000
#ExpiresByType image/jpeg A2592000
#ExpiresByType text/css A2592000
#ExpiresByType text/javascript A2592000
#ExpiresByType application/x-javascript A2592000
#ExpiresByType application/javascript A2592000

View File

@ -745,7 +745,7 @@ SSLCertificateKeyFile "WAMPROOT/myserver.key"
# You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set.
#TODO
# OPTIMIZE: To use cache on static pages (A259200 = 1 month).
# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours, A691600 = 8 days = recommanded for static resources).
# Note that you must also enable the module mod_expires.
#ExpiresActive On
#ExpiresByType image/x-icon A2592000

View File

@ -17,14 +17,14 @@ fi
# To detec
if [ "x$1" = "xlist" ]
then
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
fi
# To convert
if [ "x$1" = "xfix" ]
then
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
do
echo "Fix file $fic"
dos2unix "$fic"

View File

@ -42,7 +42,10 @@ if (! $sortorder) $sortorder="ASC";
$langs->load("admin");
$langs->load("compta");
if (! $user->admin)
// Security check
if ($user->societe_id > 0)
accessforbidden();
if (! $user->rights->accounting->fiscalyear)
accessforbidden();
$error = 0;
@ -132,7 +135,7 @@ if ($result) {
$i ++;
}
} else {
print '<tr ' . $bc[$var] . '><td colspan="5">' . $langs->trans("None") . '</td></tr>';
print '<tr ' . $bc[$var] . '><td colspan="5" class="opacitymedium">' . $langs->trans("None") . '</td></tr>';
}
print '</table>';

View File

@ -1737,7 +1737,7 @@ class Adherent extends CommonObject
$response = new WorkboardResponse();
$response->warning_delay=$conf->adherent->cotisation->warning_delay/60/60/24;
$response->label=$langs->trans("MembersWithSubscriptionToReceive");
$response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&amp;statut=1';
$response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&amp;statut=1&amp;filter=outofdate';
$response->img=img_object($langs->trans("Members"),"user");
$adherentstatic = new Adherent($this->db);
@ -2006,14 +2006,18 @@ class Adherent extends CommonObject
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
}
/**
* Return if a member is late (subscription late) or not
*
* @return boolean True if late, False if not late
*/
public function hasDelay()
{
global $conf;
//Only valid members
if ($this->statut <= 0) {
return false;
}
if ($this->statut <= 0) return false;
if (! $this->datefin) return false;
$now = dol_now();

View File

@ -128,9 +128,10 @@ if ($result)
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($statut != '') $param.="&statut=".$statut;
if ($date_select) $param.="&date_select=".$date_select;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_lastname) $param.="&search_lastname=".$search_lastname;
if ($search_login) $param.="&search_login=".$search_login;
if ($search_acount) $param.="&search_account=".$search_account;

View File

@ -104,7 +104,7 @@ if (file_exists($xmlfile))
}
else
{
print '<tr ' . $bc[false] . '><td colspan="2">'.$langs->trans("None").'</td></tr>';
print '<tr ' . $bc[false] . '><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table>';
@ -136,7 +136,7 @@ if (file_exists($xmlfile))
}
else
{
print '<tr ' . $bc[false] . '><td colspan="5">'.$langs->trans("None").'</td></tr>';
print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table>';
}

View File

@ -1445,7 +1445,7 @@ if ($id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone pictoactionview"').' <input type="submit" style="min-width: 120px" class="button buttonactionview" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"').' <input type="submit" style="min-width: 120px" class="button buttonactionview" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -1454,7 +1454,7 @@ if ($id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone pictoactionview"').' <input type="submit" style="min-width: 120px" class="button buttonactionview" name="viewday" value="'.$langs->trans("ViewDay").'">';
print img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"').' <input type="submit" style="min-width: 120px" class="button buttonactionview" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '<form name="listactionsfilterperuser" action="'.DOL_URL_ROOT.'/comm/action/peruser.php" method="POST" style="float: left; padding-right: 10px;">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -1463,7 +1463,7 @@ if ($id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone pictoactionview"').' <input type="submit" style="min-width: 120px" class="button buttonactionview" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
print img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"').' <input type="submit" style="min-width: 120px" class="button buttonactionview" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
print '</form>'."\n";
print '</div>';

View File

@ -932,6 +932,7 @@ class ActionComm extends CommonObject
$response->warning_delay = $conf->agenda->warning_delay/60/60/24;
$response->label = $langs->trans("ActionsToDo");
$response->url = DOL_URL_ROOT.'/comm/action/listactions.php?status=todo&amp;mainmenu=agenda';
if ($user->rights->agenda->allactions->read) $response->url.='&amp;filtert=-1';
$response->img = img_object($langs->trans("Actions"),"action");
// This assignment in condition is not a bug. It allows walking the results.

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
@ -78,7 +78,7 @@ if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no per
}
$action=GETPOST('action','alpha');
//$year=GETPOST("year");
$resourceid=GETPOST("resourceid","int");
$year=GETPOST("year","int")?GETPOST("year","int"):date("Y");
$month=GETPOST("month","int")?GETPOST("month","int"):date("m");
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
@ -292,6 +292,7 @@ if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
if ($filtert) $param.="&filtert=".$filtert;
@ -349,7 +350,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param);
$head = calendars_prepare_head($paramnoaction);
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,$listofextcals,$actioncode,$usergroup);
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,$listofextcals,$actioncode,$usergroup,'', $resourceid);
dol_fiche_end();
@ -424,7 +425,7 @@ else // If javascript off
$link.='</a>';
}
print load_fiche_titre($s, $link.' &nbsp; &nbsp; '.$nav, '');
print load_fiche_titre($s, $link.' &nbsp; &nbsp; '.$nav, '', 0, 0, 'tablelistofcalendars');
// Load events from database into $eventarray
@ -442,12 +443,15 @@ $sql.= ' a.fk_soc, a.fk_contact,';
$sql.= ' ca.code as type_code, ca.libelle as type_label';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table
if ($resourceid > 0) $sql.=", ".MAIN_DB_PREFIX."element_resources as r";
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
$sql.= ' WHERE a.fk_action = ca.id';
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
if ($actioncode) $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid;
@ -933,7 +937,7 @@ if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($even
$maxnbofchar=18;
$maxnbofchar=0;
$cachethirdparties=array();
$cachecontacts=array();
$cacheusers=array();
@ -1238,20 +1242,20 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
else
{
$numother++;
$color=($event->icalcolor?$event->icalcolor:-1);
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
if (empty($cacheusers[$event->userownerid]))
{
$newuser=new User($db);
$newuser->fetch($event->userownerid);
$cacheusers[$event->userownerid]=$newuser;
}
//var_dump($cacheusers[$event->userownerid]->color);
// We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
$numother++;
$color=($event->icalcolor?$event->icalcolor:-1);
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
if (empty($cacheusers[$event->userownerid]))
{
$newuser=new User($db);
$newuser->fetch($event->userownerid);
$cacheusers[$event->userownerid]=$newuser;
}
//var_dump($cacheusers[$event->userownerid]->color);
// We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
}
if ($color == -1) // Color was not forced. Set color according to color index.
{
@ -1268,7 +1272,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color
}
//print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'<br>';
// Define color
// Define color
$color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
}
$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
@ -1312,7 +1316,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
print ' -moz-border-radius:4px;" width="100%"><tr>';
print '<td class="'.($nowrapontd?'nowrap ':'').'cal_event'.($event->type_code == 'BIRTHDAY'?' cal_event_birthday':'').'">';
print '<td class="tdoverflow centpercent '.($nowrapontd?'nowrap ':'').'cal_event'.($event->type_code == 'BIRTHDAY'?' cal_event_birthday':'').'">';
if ($event->type_code == 'BIRTHDAY') // It's a birthday
{
print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact');
@ -1393,8 +1397,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($event->type_code == 'ICALEVENT') print '<br>('.dol_trunc($event->icalname,$maxnbofchar).')';
// If action related to company / contact
$linerelatedto='';$length=16;
if (! empty($event->societe->id) && ! empty($event->contact->id)) $length=round($length/2);
$linerelatedto='';
if (! empty($event->societe->id) && $event->societe->id > 0)
{
if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id]))
@ -1404,7 +1407,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cachethirdparties[$event->societe->id]=$thirdparty;
}
else $thirdparty=$cachethirdparties[$event->societe->id];
if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1,'',$length);
if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1,'',0);
}
if (! empty($event->contact->id) && $event->contact->id > 0)
{
@ -1416,7 +1419,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
else $contact=$cachecontacts[$event->contact->id];
if ($linerelatedto) $linerelatedto.=' / ';
if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',$length);
if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',0);
}
if ($linerelatedto) print '<br>'.$linerelatedto;
}

View File

@ -36,6 +36,7 @@ $langs->load("agenda");
$langs->load("commercial");
$action=GETPOST('action','alpha');
$resourceid=GETPOST("resourceid","int");
$year=GETPOST("year",'int');
$month=GETPOST("month",'int');
$day=GETPOST("day",'int');
@ -154,8 +155,10 @@ llxHeader('',$langs->trans("Agenda"),$help_url);
$listofextcals=array();
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($actioncode != '') $param.="&actioncode=".$actioncode;
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
if ($filtert) $param.="&filtert=".$filtert;
@ -178,12 +181,15 @@ $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
// We must filter on resource table
if ($resourceid > 0) $sql.=", ".MAIN_DB_PREFIX."element_resources as r";
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
$sql.= " WHERE c.id = a.fk_action";
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
if ($actioncode) $sql.=" AND c.code IN ('".$db->escape($actioncode)."')";
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
@ -242,7 +248,7 @@ if ($resql)
$head = calendars_prepare_head($param);
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,-1,$actioncode,$usergroup);
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,-1,$actioncode,$usergroup,'',$resourceid);
dol_fiche_end();
// Add link to show birthdays
@ -288,6 +294,7 @@ if ($resql)
$nav='';
if ($optioncss != '') $nav.= '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
if ($resourceid) $nav.='<input type="hidden" name="resourceid" value="'.$resourceid.'">';
if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.='<input type="hidden" name="status" value="'.$status.'">';
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';

View File

@ -76,7 +76,7 @@ if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no per
//$action=GETPOST('action','alpha');
$action='show_pertype';
//$year=GETPOST("year");
$resourceid=GETPOST("resourceid","int");
$year=GETPOST("year","int")?GETPOST("year","int"):date("Y");
$month=GETPOST("month","int")?GETPOST("month","int"):date("m");
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
@ -202,6 +202,7 @@ if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
if ($filtert) $param.="&filtert=".$filtert;
@ -252,6 +253,7 @@ $nav.='<input type="hidden" name="action" value="' . $action . '">';
$nav.='<input type="hidden" name="usertodo" value="' . $filtert . '">';
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
$nav.='<input type="hidden" name="actioncode" value="' . $actioncode . '">';
$nav.='<input type="hidden" name="resourceid" value="' . $resourceid . '">';
$nav.='<input type="hidden" name="status" value="' . $status . '">';
$nav.='<input type="hidden" name="socid" value="' . $socid . '">';
$nav.='<input type="hidden" name="projectid" value="' . $projectid . '">';
@ -279,7 +281,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param);
$head = calendars_prepare_head($paramnoaction);
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup);
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid);
dol_fiche_end();
$showextcals=$listofextcals;
@ -356,12 +358,15 @@ $sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,';
$sql.= ' ca.code, ca.color';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table
if ($resourceid > 0) $sql.=", ".MAIN_DB_PREFIX."element_resources as r";
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
$sql.= ' WHERE a.fk_action = ca.id';
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid;

View File

@ -76,7 +76,7 @@ if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no per
//$action=GETPOST('action','alpha');
$action='show_peruser'; //We use 'show_week' mode
//$year=GETPOST("year");
$resourceid=GETPOST("resourceid","int");
$year=GETPOST("year","int")?GETPOST("year","int"):date("Y");
$month=GETPOST("month","int")?GETPOST("month","int"):date("m");
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
@ -202,6 +202,7 @@ if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
if ($filtert) $param.="&filtert=".$filtert;
@ -255,6 +256,7 @@ $nav.='<input type="hidden" name="action" value="' . $action . '">';
$nav.='<input type="hidden" name="usertodo" value="' . $filtert . '">';
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
$nav.='<input type="hidden" name="actioncode" value="' . $actioncode . '">';
$nav.='<input type="hidden" name="resourceid" value="' . $resourceid . '">';
$nav.='<input type="hidden" name="status" value="' . $status . '">';
$nav.='<input type="hidden" name="socid" value="' . $socid . '">';
$nav.='<input type="hidden" name="projectid" value="' . $projectid . '">';
@ -287,7 +289,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param);
$head = calendars_prepare_head($paramnoaction);
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup);
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid);
dol_fiche_end();
$showextcals=$listofextcals;
@ -364,12 +366,15 @@ $sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,';
$sql.= ' ca.code, ca.color';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table
if ($resourceid > 0) $sql.=", ".MAIN_DB_PREFIX."element_resources as r";
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
$sql.= ' WHERE a.fk_action = ca.id';
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid;

View File

@ -517,7 +517,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
}
else
{
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table><br>";
}
@ -571,7 +571,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
}
else
{
print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
}

View File

@ -558,7 +558,7 @@ if ($object->fetch($id) >= 0)
{
if ($object->statut < 2)
{
print '<tr '.$bc[false].'><td colspan="8">';
print '<tr '.$bc[false].'><td colspan="8" class="opacitymedium">';
print $langs->trans("NoTargetYet");
print '</td></tr>';
}

View File

@ -189,7 +189,7 @@ if ($result)
}
else
{
print '<tr><td>'.$langs->trans("None").'</td></tr>';
print '<tr><td class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table><br>";
$db->free($result);

View File

@ -354,7 +354,8 @@ if ($result)
}
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($month) $param.='&month='.$month;
if ($year) $param.='&year='.$year;
if ($search_ref) $param.='&search_ref=' .$search_ref;

View File

@ -283,12 +283,12 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre" height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NbOfProposals").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="center">%</td>';
print '<td align="right">'.$langs->trans("NbOfProposals").'</td>';
print '<td align="right">%</td>';
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
print '<td align="right">%</td>';
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
print '<td align="right">%</td>';
print '</tr>';
$oldyear=0;

View File

@ -2147,7 +2147,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort');
print '</td>';
if ($action != 'editconditions' && $object->brouillon)
if ($action != 'editconditions')
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&amp;id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
@ -2165,7 +2165,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentMode');
print '</td>';
if ($action != 'editmode' && $object->brouillon)
if ($action != 'editmode')
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&amp;id=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';

View File

@ -381,7 +381,8 @@ if ($resql)
$num = $db->num_rows($resql);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($socid > 0) $param.='&socid='.$socid;
if ($viewstatut != '') $param.='&viewstatut='.$viewstatut;
if ($orderday) $param.='&orderday='.$orderday;

View File

@ -1102,6 +1102,7 @@ class Account extends CommonObject
$sql.= " AND b.fk_account = ba.rowid";
$sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")";
$sql.= " AND (ba.rappro = 1 AND ba.courant != 2)"; // Compte rapprochable
$sql.= " AND clos = 0";
if ($filteraccountid) $sql.=" AND ba.rowid = ".$filteraccountid;
$resql=$this->db->query($sql);

View File

@ -105,7 +105,7 @@ foreach ($accounts as $key=>$type)
$solde = $acc->solde(1);
print '<tr '.$bc[$var].'>';
print '<td width="30%">'.$acc->getNomUrl(1).'</td>';
print '<td class="titlefield">'.$acc->getNomUrl(1).'</td>';
print '<td>'.$acc->bank.'</td>';
print '<td>'.$acc->number.'</td>';
print '<td align="center">';
@ -116,7 +116,7 @@ foreach ($accounts as $key=>$type)
setEventMessages($acc->error, $acc->errors, 'errors');
} else {
print $result->nbtodo;
if ($result->nbtodolate) print ' ('.$result->nbtodolate.img_warning($langs->trans("Late")).')';
if ($result->nbtodolate) print ' &nbsp; ('.$result->nbtodolate.img_warning($langs->trans("Late")).')';
}
}
else print $langs->trans("FeatureDisabled");
@ -130,7 +130,7 @@ foreach ($accounts as $key=>$type)
$total[$acc->currency_code] += $solde;
}
}
if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
if (! $found) print '<tr '.$bc[$var].'><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
// Total
foreach ($total as $key=>$solde)
{
@ -182,7 +182,7 @@ foreach ($accounts as $key=>$type)
if (! $found)
{
$var = !$var;
print '<tr '.$bc[false].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[false].'><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
// Total
foreach ($total as $key=>$solde)
@ -249,7 +249,7 @@ foreach ($accounts as $key=>$type)
if (! $found)
{
$var = !$var;
print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
// Total
foreach ($total as $key=>$solde)

View File

@ -72,6 +72,7 @@ $title=$langs->trans("SpecialExpensesArea");
if ($mode == 'sconly') $title=$langs->trans("SocialContributionsPayments");
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($mode == 'sconly') $param='&mode=sconly';
if ($sortfield) $param.='&sortfield='.$sortfield;

View File

@ -187,7 +187,7 @@ if ($result)
}
else
{
print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
}

View File

@ -80,7 +80,7 @@ $childids[]=$user->id;
llxHeader();
$sql = "SELECT s.nom, s.rowid as socid,"; // Ou
$sql = "SELECT s.nom, d.fk_user, s.rowid as socid,"; // Ou
$sql.= " d.rowid, d.type, d.dated as dd, d.km,"; // Comment
$sql.= " d.fk_statut,";
$sql.= " u.lastname, u.firstname"; // Qui
@ -91,7 +91,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_
$sql.= " WHERE d.fk_user = u.rowid";
$sql.= " AND d.entity = ".$conf->entity;
if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')';
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND (sc.fk_user = " .$user->id." OR d.fk_soc IS NULL) ";
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_ref) $sql.=" AND d.rowid=".$search_ref;
@ -188,7 +188,7 @@ if ($resql)
print '<td align="center">'.dol_print_date($db->jdate($obj->dd),'day').'</td>';
// User
print '<td>';
$userstatic->id = $obj->rowid;
$userstatic->id = $obj->fk_user;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
print $userstatic->getNomUrl(1);

View File

@ -3353,7 +3353,7 @@ else if ($id > 0 || ! empty($ref))
$i ++;
}
} else {
print '<tr ' . $bc[false] . '><td colspan="' . $nbcols . '">' . $langs->trans("None") . '</td><td></td><td></td></tr>';
print '<tr ' . $bc[false] . '><td colspan="' . $nbcols . '" class="opacitymedium">' . $langs->trans("None") . '</td><td></td><td></td></tr>';
}
// }
$db->free($result);

View File

@ -962,7 +962,7 @@ class FactureRec extends CommonInvoice
if ($this->db->query($sql))
{
$this->date_when = $date;
if ($increment_nb_gen_done>0) $_facrec->nb_gen_done++;
if ($increment_nb_gen_done>0) $this->nb_gen_done++;
return 1;
}
else

View File

@ -1269,7 +1269,7 @@ else
// Nb of generation already done
print '<tr><td width="20%">'.$langs->trans("NbOfGenerationDone").'</td>';
print '<td>';
print $object->nb_gen_done?$object->nb_gen_done:'';
print $object->nb_gen_done?$object->nb_gen_done:'0';
print '</td>';
print '</tr>';
@ -1338,14 +1338,21 @@ else
//{
if ($user->rights->facture->creer)
{
if (empty($object->frequency) || $object->date_when <= $today)
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$object->thirdparty->id.'&amp;fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
}
else
{
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>';
}
if (! empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max))
{
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>';
}
else
{
if (empty($object->frequency) || $object->date_when <= $today)
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$object->thirdparty->id.'&amp;fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
}
else
{
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>';
}
}
}
else
{
@ -1431,6 +1438,7 @@ else
$num = $db->num_rows($resql);
$param='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($day) $param.='&day='.$day;
if ($month) $param.='&month='.$month;

View File

@ -792,6 +792,7 @@ if ($resql)
}
$param='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($day) $param.='&day='.$day;
if ($month) $param.='&month='.$month;

View File

@ -262,12 +262,12 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre" height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NumberOfBills").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="center">%</td>';
print '<td align="right">'.$langs->trans("NumberOfBills").'</td>';
print '<td align="right">%</td>';
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
print '<td align="right">%</td>';
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
print '<td align="right">%</td>';
print '</tr>';
$oldyear=0;

View File

@ -543,7 +543,7 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
}
else
{
print '<tr '.$bc[$var].'><td colspan="4">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
}
@ -614,7 +614,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
}
else
{
print '<tr '.$bc[$var].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table><br>";
$db->free($resql);

View File

@ -121,6 +121,7 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -214,7 +215,7 @@ if ($resql)
else
{
print "<tr ".$bc[$var].">";
print '<td colspan="7">'.$langs->trans("None")."</td>";
print '<td colspan="7" class="opacitymedium">'.$langs->trans("None")."</td>";
print '</tr>';
}
print "</table>";

View File

@ -0,0 +1,463 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compat/paiement/class/cpaiement.class.php
* \ingroup facture
* \brief This file is to manage CRUD function of type of payments
*/
/**
* Class Cpaiement
*/
class Cpaiement
{
/**
* @var string Id to identify managed objects
*/
public $element = 'cpaiement';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'c_paiement';
/**
* @var CpaiementLine[] Lines
*/
public $lines = array();
/**
*/
public $code;
public $libelle;
public $type;
public $active;
public $accountancy_code;
public $module;
/**
*/
/**
* Constructor
*
* @param DoliDb $db Database handler
*/
public function __construct(DoliDB $db)
{
$this->db = $db;
}
/**
* Create object into database
*
* @param User $user User that creates
* @param bool $notrigger false=launch triggers after, true=disable triggers
*
* @return int <0 if KO, Id of created object if OK
*/
public function create(User $user, $notrigger = false)
{
dol_syslog(__METHOD__, LOG_DEBUG);
$error = 0;
// Clean parameters
if (isset($this->code)) {
$this->code = trim($this->code);
}
if (isset($this->libelle)) {
$this->libelle = trim($this->libelle);
}
if (isset($this->type)) {
$this->type = trim($this->type);
}
if (isset($this->active)) {
$this->active = trim($this->active);
}
if (isset($this->accountancy_code)) {
$this->accountancy_code = trim($this->accountancy_code);
}
if (isset($this->module)) {
$this->module = trim($this->module);
}
// Check parameters
// Put here code to add control on parameters values
// Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '(';
$sql.= 'id,';
$sql.= 'code,';
$sql.= 'libelle,';
$sql.= 'type,';
$sql.= 'active,';
$sql.= 'accountancy_code,';
$sql.= 'module';
$sql .= ') VALUES (';
$sql .= ' '.(! isset($this->id)?'NULL':$this->id).',';
$sql .= ' '.(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").',';
$sql .= ' '.(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").',';
$sql .= ' '.(! isset($this->type)?'NULL':$this->type).',';
$sql .= ' '.(! isset($this->active)?'NULL':$this->active).',';
$sql .= ' '.(! isset($this->accountancy_code)?'NULL':"'".$this->db->escape($this->accountancy_code)."'").',';
$sql .= ' '.(! isset($this->module)?'NULL':"'".$this->db->escape($this->module)."'");
$sql .= ')';
$this->db->begin();
$resql = $this->db->query($sql);
if (!$resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) $error++;
//// End call triggers
}
}
// Commit or rollback
if ($error) {
$this->db->rollback();
return - 1 * $error;
} else {
$this->db->commit();
return $this->id;
}
}
/**
* Load object in memory from the database
*
* @param int $id Id object
* @param string $ref Ref
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetch($id, $ref = null)
{
dol_syslog(__METHOD__, LOG_DEBUG);
$sql = 'SELECT';
$sql .= ' t.id,';
$sql .= " t.code,";
$sql .= " t.libelle,";
$sql .= " t.type,";
$sql .= " t.active,";
$sql .= " t.accountancy_code,";
$sql .= " t.module";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
if (null !== $ref) {
$sql .= ' WHERE t.code = ' . '\'' . $ref . '\'';
} else {
$sql .= ' WHERE t.id = ' . $id;
}
$resql = $this->db->query($sql);
if ($resql) {
$numrows = $this->db->num_rows($resql);
if ($numrows) {
$obj = $this->db->fetch_object($resql);
$this->id = $obj->id;
$this->code = $obj->code;
$this->libelle = $obj->libelle;
$this->type = $obj->type;
$this->active = $obj->active;
$this->accountancy_code = $obj->accountancy_code;
$this->module = $obj->module;
}
$this->db->free($resql);
if ($numrows) {
return 1;
} else {
return 0;
}
} else {
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
return - 1;
}
}
/**
* Load object in memory from the database
*
* @param string $sortorder Sort Order
* @param string $sortfield Sort field
* @param int $limit offset limit
* @param int $offset offset limit
* @param array $filter filter array
* @param string $filtermode filter mode (AND or OR)
*
* @return int <0 if KO, >0 if OK
*/
public function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter = array(), $filtermode='AND')
{
dol_syslog(__METHOD__, LOG_DEBUG);
$sql = 'SELECT';
$sql .= ' t.id,';
$sql .= " t.code,";
$sql .= " t.libelle,";
$sql .= " t.type,";
$sql .= " t.active,";
$sql .= " t.accountancy_code,";
$sql .= " t.module";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element. ' as t';
// Manage filter
$sqlwhere = array();
if (count($filter) > 0) {
foreach ($filter as $key => $value) {
$sqlwhere [] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\'';
}
}
if (count($sqlwhere) > 0) {
$sql .= ' WHERE ' . implode(' '.$filtermode.' ', $sqlwhere);
}
if (!empty($sortfield)) {
$sql .= $this->db->order($sortfield,$sortorder);
}
if (!empty($limit)) {
$sql .= ' ' . $this->db->plimit($limit + 1, $offset);
}
$this->lines = array();
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
while ($obj = $this->db->fetch_object($resql)) {
$line = new CpaiementLine();
$line->id = $obj->id;
$line->code = $obj->code;
$line->libelle = $obj->libelle;
$line->type = $obj->type;
$line->active = $obj->active;
$line->accountancy_code = $obj->accountancy_code;
$line->module = $obj->module;
$this->lines[$line->id] = $line;
}
$this->db->free($resql);
return $num;
} else {
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
return - 1;
}
}
/**
* Update object into database
*
* @param User $user User that modifies
* @param bool $notrigger false=launch triggers after, true=disable triggers
*
* @return int <0 if KO, >0 if OK
*/
public function update(User $user, $notrigger = false)
{
$error = 0;
dol_syslog(__METHOD__, LOG_DEBUG);
// Clean parameters
if (isset($this->code)) {
$this->code = trim($this->code);
}
if (isset($this->libelle)) {
$this->libelle = trim($this->libelle);
}
if (isset($this->type)) {
$this->type = trim($this->type);
}
if (isset($this->active)) {
$this->active = trim($this->active);
}
if (isset($this->accountancy_code)) {
$this->accountancy_code = trim($this->accountancy_code);
}
if (isset($this->module)) {
$this->module = trim($this->module);
}
// Check parameters
// Put here code to add a control on parameters values
// Update request
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET';
$sql .= ' id = '.(isset($this->id)?$this->id:"null").',';
$sql .= ' code = '.(isset($this->code)?"'".$this->db->escape($this->code)."'":"null").',';
$sql .= ' libelle = '.(isset($this->libelle)?"'".$this->db->escape($this->libelle)."'":"null").',';
$sql .= ' type = '.(isset($this->type)?$this->type:"null").',';
$sql .= ' active = '.(isset($this->active)?$this->active:"null").',';
$sql .= ' accountancy_code = '.(isset($this->accountancy_code)?"'".$this->db->escape($this->accountancy_code)."'":"null").',';
$sql .= ' module = '.(isset($this->module)?"'".$this->db->escape($this->module)."'":"null");
$sql .= ' WHERE id=' . $this->id;
$this->db->begin();
$resql = $this->db->query($sql);
if (!$resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
// Commit or rollback
if ($error) {
$this->db->rollback();
return - 1 * $error;
} else {
$this->db->commit();
return 1;
}
}
/**
* Delete object in database
*
* @param User $user User that deletes
* @param bool $notrigger false=launch triggers after, true=disable triggers
*
* @return int <0 if KO, >0 if OK
*/
public function delete(User $user, $notrigger = false)
{
dol_syslog(__METHOD__, LOG_DEBUG);
$error = 0;
$this->db->begin();
if (!$error) {
if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
if (!$error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
$sql .= ' WHERE id=' . $this->id;
$resql = $this->db->query($sql);
if (!$resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
}
// Commit or rollback
if ($error) {
$this->db->rollback();
return - 1 * $error;
} else {
$this->db->commit();
return 1;
}
}
/**
* Initialise object with example values
* Id must be 0 if object instance is a specimen
*
* @return void
*/
public function initAsSpecimen()
{
$this->id = 0;
$this->code = '';
$this->libelle = '';
$this->type = '';
$this->active = '';
$this->accountancy_code = '';
$this->module = '';
}
}

View File

@ -62,8 +62,9 @@ class Paiement extends CommonObject
var $bank_line; // Id de la ligne d'ecriture bancaire
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
// fk_paiement dans llx_paiement_facture est le rowid du paiement
var $fk_paiement; // Type of paiment
/**
* Constructor
*

View File

@ -203,6 +203,7 @@ if ($resql)
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
$param.=(GETPOST("orphelins")?"&orphelins=1":"");
$param.=($search_ref?"&search_ref=".urlencode($search_ref):"");

View File

@ -235,7 +235,7 @@ if ($resql)
$i++;
}
}
else print '<tr '.$bc[0].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
else print '<tr '.$bc[0].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print "</table>";
print "<br>\n";
}

View File

@ -279,7 +279,7 @@ if ($total_ttc == 0)
{
$var=!$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}
@ -362,7 +362,7 @@ if ($result) {
{
$var=!$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}
@ -439,7 +439,7 @@ if ($result) {
else {
$var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}
} else {
@ -517,7 +517,7 @@ if ($result) {
else {
$var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}
} else {
@ -606,7 +606,7 @@ if (! empty($conf->salaries->enabled))
{
$var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}
}
@ -629,7 +629,7 @@ if (! empty($conf->expensereport->enabled))
{
$langs->load('trips');
if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT p.rowid, p.ref, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc";
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author";
$sql.= " WHERE p.entity = ".getEntity('expensereport',1);
@ -688,7 +688,7 @@ if (! empty($conf->expensereport->enabled))
{
$var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}
}
@ -757,7 +757,7 @@ if (! empty($conf->don->enabled))
{
$var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}
}

View File

@ -127,7 +127,8 @@ if ($result)
$var=true;
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($typeid) $param.='&amp;typeid='.$typeid;
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;

View File

@ -138,7 +138,8 @@ if ($resql)
$var=true;
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($year) $param.='&amp;year='.$year;
if ($typeid) $param.='&amp;typeid='.$typeid;

View File

@ -322,7 +322,7 @@ if (is_array($coll_list)) {
//print load_fiche_titre($vatsup);
//print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print "<tr class=\"liste_titre liste_titre_topborder\">";
print '<td align="left">'.$langs->trans("Num")."</td>";
print '<td align="left">'.$langs->trans("Supplier")."</td>";
print "<td>".$langs->trans("VATIntra")."</td>";

View File

@ -479,7 +479,7 @@ else
//print table headers for this quadri - expenses now
//imprime les en-tete de tables pour ce quadri - maintenant les d<>penses
print '<tr class="liste_titre">';
print '<tr class="liste_titre liste_titre_topborder">';
print '<td align="left">'.$elementsup.'</td>';
print '<td align="left">'.$productsup.'</td>';
if ($modetax == 0)

View File

@ -134,7 +134,8 @@ if ($result)
$var=true;
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($typeid) $param.='&amp;typeid='.$typeid;
@ -211,7 +212,7 @@ if ($result)
$i++;
}
print '<tr class="liste_total"><td colspan="4">'.$langs->trans("Total").'</td>';
print '<tr class="liste_total"><td colspan="5">'.$langs->trans("Total").'</td>';
print "<td align=\"right\"><b>".price($total)."</b></td>";
print "<td>&nbsp;</td></tr>";

View File

@ -369,6 +369,7 @@ if ($result)
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
$param.='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
$param.='&type='.urlencode($type).'&view='.urlencode($view);

View File

@ -2220,18 +2220,18 @@ class Contrat extends CommonObject
*/
class ContratLigne extends CommonObjectLine
{
public $element='contratdet';
public $table_element='contratdet';
var $id;
var $ref;
var $tms;
var $fk_contrat;
var $fk_product;
var $statut; // 0 inactive, 4 active, 5 closed
var $type; // 0 for product, 1 for service
var $label;
public $element='contratdet';
public $table_element='contratdet';
/**
* @var string
* @deprecated Use $label instead
@ -2240,6 +2240,10 @@ class ContratLigne extends CommonObjectLine
public $libelle;
var $description;
var $product_ref;
var $product_label;
var $date_commande;
var $date_ouverture_prevue; // date start planned
var $date_ouverture; // date start real
@ -2379,16 +2383,17 @@ class ContratLigne extends CommonObjectLine
$result='';
$label=$langs->trans("ShowContractOfService").': '.$this->label;
if (empty($label)) $label=$this->description;
$link = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->fk_contrat.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='contract';
$picto='service';
if ($this->type == 0) $picto='product';
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$link.$this->label.$linkend;
if ($withpicto != 2) $result.=$link.($this->product_ref?$this->product_ref.' ':'').($this->label?$this->label:$this->description).$linkend;
return $result;
}
@ -2417,6 +2422,7 @@ class ContratLigne extends CommonObjectLine
$sql.= " p.ref as product_ref,";
$sql.= " p.label as product_label,";
$sql.= " p.description as product_desc,";
$sql.= " p.type as product_type,";
$sql.= " t.description,";
$sql.= " t.date_commande,";
$sql.= " t.date_ouverture_prevue as date_ouverture_prevue,";
@ -2467,6 +2473,7 @@ class ContratLigne extends CommonObjectLine
$this->product_ref = $obj->product_ref;
$this->product_label = $obj->product_label;
$this->product_description = $obj->product_description;
$this->product_type = $obj->product_type;
$this->label = $obj->label; // deprecated. We do not use this field. Only ref and label of product, and description of contract line
$this->description = $obj->description;
$this->date_commande = $this->db->jdate($obj->date_commande);

View File

@ -170,6 +170,7 @@ if ($resql)
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
$param.='&search_contract='.$search_contract;
$param.='&search_name='.$search_name;

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
@ -267,14 +267,14 @@ if ($resql)
$productstatic->type=$obj->ptype;
$productstatic->ref=$obj->pref;
$productstatic->entity=$obj->pentity;
print $productstatic->getNomUrl(1,'',20);
print $productstatic->getNomUrl(1,'',24);
print $obj->label?' - '.dol_trunc($obj->label,16):'';
if (! empty($obj->description) && ! empty($conf->global->PRODUCT_DESC_IN_LIST)) print '<br>'.dol_nl2br($obj->description);
}
else
{
if ($obj->type == 0) print img_object($obj->description,'product').dol_trunc($obj->description,20);
if ($obj->type == 1) print img_object($obj->description,'service').dol_trunc($obj->description,20);
if ($obj->type == 0) print img_object($obj->description,'product').' '.dol_trunc($obj->description,24);
if ($obj->type == 1) print img_object($obj->description,'service').' '.dol_trunc($obj->description,24);
}
print '</td>';
@ -291,7 +291,7 @@ if ($resql)
print '<td align="center">';
print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):'&nbsp;');
if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)))
print img_picto($langs->trans("Late"),"warning");
print ' '.img_picto($langs->trans("Late"),"warning");
else print '&nbsp;&nbsp;&nbsp;&nbsp;';
print '</td>';
}

View File

@ -55,13 +55,15 @@ class box_contracts extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$contractstatic=new Contrat($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastContracts",$max));
if ($user->rights->contrat->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
$contractstatic=new Contrat($db);
$thirdpartytmp=new Societe($db);
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -80,7 +82,10 @@ class box_contracts extends ModeleBoxes
$line = 0;
while ($line < $num) {
$langs->load("contracts");
while ($line < $num)
{
$objp = $db->fetch_object($resql);
$datec=$db->jdate($objp->datec);
$dateterm=$db->jdate($objp->fin_validite);
@ -89,38 +94,26 @@ class box_contracts extends ModeleBoxes
$contractstatic->statut=$objp->fk_statut;
$contractstatic->id=$objp->rowid;
$contractstatic->ref=$objp->ref;
$result=$contractstatic->fetch_lines();
$thirdpartytmp->name = $objp->name;
$thirdpartytmp->id = $objp->socid;
// fin_validite is no more on contract but on services
// if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->contrat->cloture->warning_delay)) { $late = img_warning($langs->trans("Late")); }
$this->info_box_contents[$line][] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('Contract').': '.($objp->ref?$objp->ref:$objp->rowid),
'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref
'tooltip' => $langs->trans('Contract').': '.($objp->ref?$objp->ref:$objp->rowid),
'text' => $contractstatic->getNomUrl(1),
'text2'=> $late,
'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$line][] = array(
'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
'asis'=>1
);
$this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => dol_trunc($objp->name,40),
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
'text' => $thirdpartytmp->getNomUrl(1),
'asis'=>1
);
$this->info_box_contents[$line][] = array(

View File

@ -56,26 +56,28 @@ class box_services_contracts extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$contratlignestatic=new ContratLigne($db);
$this->info_box_head = array('text' => $langs->trans("BoxLastProductsInContract",$max));
if ($user->rights->service->lire && $user->rights->contrat->lire)
{
$contractstatic=new Contrat($db);
$contratlignestatic=new ContratLigne($db);
$thirdpartytmp = new Societe($db);
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.rowid,";
$sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut,";
$sql.= " p.rowid as pid, p.label, p.fk_product_type";
$sql.= " c.rowid, c.ref, c.statut as contract_status,";
$sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut, cd.label, cd.description, cd.product_type as type,";
$sql.= " p.rowid as product_id, p.ref as product_ref";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."contratdet as cd";
$sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";
$sql.= " WHERE c.entity = ".$conf->entity;
$sql.= " AND s.rowid = c.fk_soc";
$sql.= " AND c.rowid = cd.fk_contrat";
$sql.= " AND cd.fk_product = p.rowid";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= $db->order("c.tms","DESC");
@ -94,12 +96,27 @@ class box_services_contracts extends ModeleBoxes
$objp = $db->fetch_object($result);
$datem=$db->jdate($objp->datem);
$contratlignestatic->id=$objp->cdid;
$contratlignestatic->fk_contrat=$objp->rowid;
$contratlignestatic->label=$objp->label;
$contratlignestatic->description=$objp->description;
$contratlignestatic->type=$objp->type;
$contratlignestatic->product_id=$objp->product_id;
$contratlignestatic->product_ref=$objp->product_ref;
$contractstatic->statut=$objp->contract_status;
$contractstatic->id=$objp->rowid;
$contractstatic->ref=$objp->ref;
$thirdpartytmp->name = $objp->name;
$thirdpartytmp->id = $objp->socid;
// Multilangs
if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active
{
$sqld = "SELECT label";
$sqld.= " FROM ".MAIN_DB_PREFIX."product_lang";
$sqld.= " WHERE fk_product=".$objp->pid;
$sqld.= " WHERE fk_product=".$objp->product_id;
$sqld.= " AND lang='". $langs->getDefaultLang() ."'";
$sqld.= " LIMIT 1";
@ -107,32 +124,29 @@ class box_services_contracts extends ModeleBoxes
if ($resultd)
{
$objtp = $db->fetch_object($resultd);
if ($objtp->label != '') $objp->label = $objtp->label;
if ($objtp->label != '') $contratlignestatic->label = $objtp->label;
}
}
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => ($objp->fk_product_type==1?'object_service':'object_product'),
'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid);
$this->info_box_contents[$i][] = array('td' => 'align="left"',
'text' => $contratlignestatic->getNomUrl(1),
'asis' => 1
);
$this->info_box_contents[$i][] = array('td' => 'align="left"',
'text' => $contractstatic->getNomUrl(1),
'asis' => 1
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->label,
'maxlength' => 16,
'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid);
$this->info_box_contents[$i][] = array('td' => 'align="left"',
'text' => $thirdpartytmp->getNomUrl(1),
'asis' => 1
);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->name,
'maxlength' => 28,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
$this->info_box_contents[$i][] = array('td' => 'align="right"',
'text' => dol_print_date($datem,'day'));
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
$this->info_box_contents[$i][] = array('td' => 'align="right" width="18"',
'text' => $contratlignestatic->LibStatut($objp->statut,3)
);

View File

@ -5948,7 +5948,7 @@ class Form
{
console.log("We uncheck all");
$(".'.$cssclass.'").prop(\'checked\', false);
}';
}'."\n";
if ($calljsfunction) $out.='if (typeof initCheckForSelect == \'function\') { initCheckForSelect(); } else { console.log("No function initCheckForSelect found. Call won\'t done."); }';
$out.=' });
});

View File

@ -661,7 +661,7 @@ class FormFile
if (count($file_list) == 0 && $headershown)
{
$out.='<tr '.$bc[0].'><td colspan="3">'.$langs->trans("None").'</td></tr>';
$out.='<tr '.$bc[0].'><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
$this->numoffiles++;

View File

@ -715,9 +715,11 @@ class FormMail extends Form
$out.= "</td></tr>\n";
}
$out.= '</table>'."\n";
if ($this->withform == 1 || $this->withform == -1)
{
$out.= '<tr><td align="center" colspan="2"><div class="center">';
$out.= '<br><div class="center">';
$out.= '<input class="button" type="submit" id="sendmail" name="sendmail" value="'.$langs->trans("SendMail").'"';
// Add a javascript test to avoid to forget to submit file before sending email
if ($this->withfile == 2 && $conf->use_javascript_ajax)
@ -730,11 +732,9 @@ class FormMail extends Form
$out.= ' &nbsp; &nbsp; ';
$out.= '<input class="button" type="submit" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'" />';
}
$out.= '</div></td></tr>'."\n";
$out.= '</div>'."\n";
}
$out.= '</table>'."\n";
if ($this->withform == 1) $out.= '</form>'."\n";
// Disable enter key if option MAIN_MAILFORM_DISABLE_ENTERKEY is set

View File

@ -255,7 +255,7 @@ class FormMargin
if (! empty($conf->product->enabled) && ! empty($conf->service->enabled))
{
print '<tr class="impair">';
print '<tr class="liste_total">';
print '<td>'.$langs->trans('TotalMargin').'</td>';
print '<td align="right">'.price($marginInfo['pv_total'], null, null, null, null, $rounding).'</td>';
print '<td align="right">'.price($marginInfo['pa_total'], null, null, null, null, $rounding).'</td>';

View File

@ -41,12 +41,13 @@
* @param int $socid Third party id
* @param string $action Action string
* @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend
* @param string|array $actioncode Preselected value(s) of actioncode for filter on type
* @param string|array $actioncode Preselected value(s) of actioncode for filter on event type
* @param int $usergroupid Id of group to filter on users
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
* @param int $resourceid Preselected value of resource for filter on resource
* @return void
*/
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='')
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='', $resourceid=0)
{
global $conf, $user, $langs, $db, $hookmanager;
global $begin_h, $end_h, $begin_d, $end_d;
@ -80,6 +81,20 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit);
print '</td></tr>';
if ($conf->resource->enabled)
{
include_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php';
$formresource=new FormResource($db);
// Resource
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
print $langs->trans("Resource");
print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">';
print $formresource->select_resource_list($resourceid, "resourceid", '', 1, 0, 0, null, '', 2);
print '</td></tr>';
}
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions=new FormActions($db);

View File

@ -551,7 +551,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
else
{
$var = false;
print '<tr '.$bc[$var].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
$db->free($result);
}
@ -766,7 +766,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
else
{
print "<tr ".$bc[! $var].">";
print '<td colspan="'.$colspan.'">'.$langs->trans("None").'</td>';
print '<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td>';
print "</tr>\n";
}
print "\n</table>\n";

View File

@ -2981,10 +2981,11 @@ function print_fiche_titre($title, $mesg='', $picto='title_generic.png', $pictoi
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param int $id To force an id on html objects
* @param string $morecssontable More css on table
* @return string
* @see print_barre_liste
*/
function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictoisfullpath=0, $id=0)
function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='')
{
global $conf;
@ -2994,7 +2995,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois
if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif';
$return.= "\n";
$return.= '<table '.($id?'id="'.$id.'" ':'').'summary="" width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>';
$return.= '<table '.($id?'id="'.$id.'" ':'').'summary="" class="centpercent notopnoleftnoright'.($morecssontable?' '.$morecssontable:'').'" style="margin-bottom: 2px;"><tr>';
if ($picto) $return.= '<td class="nobordernopadding hideonsmartphone" width="40" align="left" valign="middle">'.img_picto('',$picto, 'id="pictotitle"', $pictoisfullpath).'</td>';
$return.= '<td class="nobordernopadding" valign="middle">';
$return.= '<div class="titre">'.$titre.'</div>';
@ -4135,8 +4136,7 @@ function yn($yesno, $case=1, $color=0)
/**
* Return a path to have a directory according to object.
* New usage: $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart')
* Old usage: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/"
* Old usage: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/"
* Old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/"
*
* @param string $num Id of object (deprecated, $object will be used in future)
* @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future)
@ -5342,6 +5342,11 @@ function printCommonFooter($zone='private')
});'."\n";
print '});'."\n";
print '<!-- Set handler to switch left menu page -->'."\n";
print 'jQuery(".menuhider").click(function() {';
print " $('.side-nav').toggle(); ";
print '});'."\n";
print '</script>'."\n";
}

View File

@ -41,15 +41,15 @@ function loan_prepare_head($object)
$head[$tab][2] = 'card';
$tab++;
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
$head[$tab][1] = $langs->trans("Notes");
if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$tab][2] = 'note';
$tab++;
}
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
$head[$tab][1] = $langs->trans("Notes");
if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$tab][2] = 'note';
$tab++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line

View File

@ -42,8 +42,10 @@ function resource_prepare_head($object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/resource/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('Contact');
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/resource/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}

View File

@ -62,11 +62,16 @@ function shipping_prepare_head($object)
}
}
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
$head[$h][1] = $langs->trans("ContactsAddresses");
$head[$h][2] = 'contact';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
$head[$h][1] = $langs->trans("ContactsAddresses");
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}
$nbNote = 0;
if (!empty($object->note_private)) $nbNote++;
if (!empty($object->note_public)) $nbNote++;

View File

@ -54,7 +54,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
if (GETPOST('testmenuhider') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$showmode=1;
$classname = 'class="tmenu"';
$classname = 'class="tmenu menuhider"';
$idsel='menu';
if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode);
@ -1425,13 +1425,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$altok++;
$blockvmenuopened=true;
$lastopened=true;
for($j = ($i + 1); $j < $num; $j++)
{
if (empty($menu_array[$j]['level'])) $lastopened=false;
}
if ($altok % 2 == 0)
{
print '<div class="blockvmenuimpair'.$invert.($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
print '<div class="blockvmenu blockvmenuimpair'.$invert.($lastopened?' blockvmenulast':'').($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
}
else
{
print '<div class="blockvmenupair'.$invert.($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
print '<div class="blockvmenu blockvmenupair'.$invert.($lastopened?' blockvmenulast':'').($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
}
}

View File

@ -119,6 +119,7 @@ class pdf_rouget extends ModelePdfExpedition
$outputlangs->load("propal");
$outputlangs->load("deliveries");
$outputlangs->load("sendings");
$outputlangs->load("productbatch");
$nblignes = count($object->lines);

View File

@ -119,7 +119,7 @@ class modResource extends DolibarrModules
// Minimum version of PHP required by module
$this->phpmin = array(5, 3);
$this->langfiles = array("resource@resource"); // langfiles@resource
$this->langfiles = array("resource"); // langfiles@resource
// Constants
// List of particular constants to add when module is enabled
// (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)

View File

@ -135,10 +135,10 @@ class modTax extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE c.fk_type = cc.id';
$this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('tax',1).')';
// Import Taxes
// Import social contributions
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="ImportDataset_tax_1"; // Translation key
$this->import_label[$r]="ImportDataset_tax_contrib"; // Translation key
$this->import_icon[$r]='tax';
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('t'=>MAIN_DB_PREFIX.'chargesociales');
@ -152,6 +152,25 @@ class modTax extends DolibarrModules
$this->import_examplevalues_array[$r]=array('t.libelle'=>"Social/fiscal contribution",'t.fk_type'=>"TAXPRO (must be id or code found into dictionary)",
't.date_ech'=>"2016-01-01", 't.periode'=>"2016-01-01"
);
// Import Taxes
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="ImportDataset_tax_vat"; // Translation key
$this->import_icon[$r]='tax';
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('t'=>MAIN_DB_PREFIX.'tva');
$this->import_fields_array[$r]=array('t.datep'=>"DatePayment*",'t.datev'=>"DateValue*",'t.label'=>"Label*",'t.fk_typepayment'=>"PaymentMode*",
't.amount'=>"Amount*",'t.num_payment'=>'Numero'
);
$this->import_convertvalue_array[$r]=array(
't.fk_typepayment'=>array('rule'=>'fetchidfromref','classfile'=>'/compta/paiement/class/cpaiement.class.php','class'=>'Cpaiement','method'=>'fetch','element'=>'Cpaiement')
);
$this->import_examplevalues_array[$r]=array('t.label'=>"VAT Payment 1st quarter 2016",'t.fk_typepayment'=>"CHQ (must be id or code found into dictionary)",
't.datep'=>"2016-04-02", 't.datev'=>"2016-03-31", 't.amount'=>1000, 't.num_payment'=>'123456'
);
}

View File

@ -458,7 +458,7 @@ class printing_printgcp extends PrintingDriver
else
{
$html .= '<tr '.$bc[$var].'>';
$html .= '<td colspan="6">'.$langs->trans("None").'</td>';
$html .= '<td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td>';
$html .= '</tr>';
}
$html .= '</table>';

View File

@ -5,34 +5,33 @@
$form= new Form($db);
print '<div class="tagtable centpercent noborder allwidth">';
if($mode == 'edit' )
{
print '<form class="tagtr liste_titre">';
print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd"></div>';
print '</form>';
}
else
{
print '<form class="tagtr liste_titre">';
print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd"></div>';
print '</form>';
}
if( (array) $linked_resources && count($linked_resources) > 0)
{
$var=true;
print '<div class="tagtable centpercent noborder allwidth">';
if($mode == 'edit' )
{
print '<form class="tagtr liste_titre">';
print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd"></div>';
print '</form>';
}
else
{
print '<form class="tagtr liste_titre">';
print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Type').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd"></div>';
print '</form>';
}
foreach ($linked_resources as $linked_resource)
{
$var=!$var;
@ -56,7 +55,6 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print '<div class="tagtd" align="center">'.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'</div>';
print '<div class="tagtd" align="right"><input type="submit" class="button" value="'.$langs->trans("Update").'"></div>';
print '</form>';
}
else
{
@ -96,11 +94,13 @@ if( (array) $linked_resources && count($linked_resources) > 0)
}
}
print '</div>';
}
else {
print '<div class="warning">'.$langs->trans('NoResourceLinked').'</div>';
print '<div class="tagtr '.($var==true?"pair":"impair").'"><div class="tagtd opacitymedium">'.$langs->trans('NoResourceLinked').'</div></div>';
}
print '</div>';
?>
<!-- END TEMPLATE resource_view.tpl.php -->

View File

@ -256,7 +256,8 @@ if ($resql)
$expedition = new Expedition($db);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_ref_exp) $param.= "&amp;search_ref_exp=".$search_ref_exp;
if ($search_ref_liv) $param.= "&amp;search_ref_liv=".$search_ref_liv;
if ($search_company) $param.= "&amp;search_company=".$search_company;

View File

@ -1401,6 +1401,7 @@ else
print '<td>'.$langs->trans("NotePrivate").'</td>';
print '<td colspan="2">'.$object->note_private.'</td>';
print '</tr>';
// Amount
print '<tr>';
print '<td>'.$langs->trans("AmountHT").'</td>';
print '<td>'.price($object->total_ht).'</td>';
@ -1412,9 +1413,8 @@ else
if($object->fk_statut==6) $rowspan+=2;
print '<td rowspan="'.$rowspan.'" valign="top">';
/*
* Payments
*/
// List of payments
$sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount,";
$sql.= "c.code as type_code,c.libelle as payment_type";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_expensereport as p";
@ -1499,9 +1499,13 @@ else
}
print '</td></tr>';
// Validation date
print '<tr>';
print '<td>'.$langs->trans("DATE_SAVE").'</td>';
print '<td>'.dol_print_date($object->date_create,'dayhour').'</td></tr>';
print '<td>'.dol_print_date($object->date_create,'dayhour');
if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late"));
if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late"));
print '</td></tr>';
print '</tr>';
// User to inform
@ -1515,7 +1519,11 @@ else
$userfee=new User($db);
$userfee->fetch($object->fk_user_validator);
print $userfee->getNomUrl(1);
if (empty($userfee->email) || ! isValidEmail($userfee->email)) print img_warning($langs->trans("EmailNotValid"));
if (empty($userfee->email) || ! isValidEmail($userfee->email))
{
$langs->load("errors");
print img_warning($langs->trans("ErrorBadEMail", $userfee->email));
}
}
print '</td></tr>';
}

View File

@ -1613,6 +1613,28 @@ class ExpenseReport extends CommonObject
return -1;
}
}
/**
* Return if an expense report is late or not
*
* @param string $option 'topay' or 'toapprove'
* @return boolean True if late, False if not late
*/
public function hasDelay($option)
{
global $conf;
//Only valid members
if ($option == 'toapprove' && $this->status != 2) return false;
if ($option == 'topay' && $this->status != 5) return false;
$now = dol_now();
if ($option == 'toapprove')
return $this->datevalid < ($now - $conf->expensereport->approve->warning_delay);
else
return $this->datevalid < ($now - $conf->expensereport->payment->warning_delay);
}
}

View File

@ -201,7 +201,7 @@ if ($result)
}
else
{
print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
}

View File

@ -81,7 +81,6 @@ $fieldstosearchall = array(
$form = new Form($db);
$formother = new FormOther($db);
$expensereporttmp=new ExpenseReport($db);
llxHeader('', $langs->trans("ListOfTrips"));
@ -104,7 +103,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,";
$sql.= " d.date_debut, d.date_fin,";
$sql.= " d.date_debut, d.date_fin, d.date_valid,";
$sql.= " u.rowid as id_user, u.firstname, u.lastname";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON d.fk_user_author = u.rowid";
@ -244,7 +243,8 @@ if ($resql)
print '</td>';
// User
if ($user->rights->expensereport->readall || $user->rights->expensereport->lire_tous){
if ($user->rights->expensereport->readall || $user->rights->expensereport->lire_tous)
{
print '<td class="liste_titre" align="left">';
print $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td>';
@ -280,7 +280,7 @@ if ($resql)
$expensereportstatic=new ExpenseReport($db);
if($num > 0)
if ($num > 0)
{
while ($i < min($num,$limit))
{
@ -288,21 +288,27 @@ if ($resql)
$expensereportstatic->id=$objp->rowid;
$expensereportstatic->ref=$objp->ref;
$expensereportstatic->status=$objp->status;
$expensereportstatic->valid=$objp->date_valid;
$expensereportstatic->date_debut=$objp->date_debut;
$expensereportstatic->date_fin=$objp->date_fin;
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
print '<td>';
print $expensereportstatic->getNomUrl(1);
print $expensereportstatic->status;
if ($expensereportstatic->status == 2 && $expensereportstatic->hasDelay('toappove')) print img_warning($langs->trans("Late"));
if ($expensereportstatic->status == 5 && $expensereportstatic->hasDelay('topay')) print img_warning($langs->trans("Late"));
print '</td>';
print '<td align="center">'.($objp->date_debut > 0 ? dol_print_date($objp->date_debut, 'day') : '').'</td>';
print '<td align="center">'.($objp->date_fin > 0 ? dol_print_date($objp->date_fin, 'day') : '').'</td>';
print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->id_user.'">'.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($objp->firstname, $objp->lastname).'</a></td>';
print '<td align="right">'.price($objp->total_ht).'</td>';
print '<td align="right">'.price($objp->total_tva).'</td>';
print '<td align="right">'.price($objp->total_ttc).'</td>';
$expensereporttmp->status=$objp->status;
print '<td align="right">';
//print $objp->status;
print $expensereporttmp->getLibStatut(5);
print $expensereportstatic->getLibStatut(5);
print '</td>';
print '<td></td>';

View File

@ -241,9 +241,9 @@ print '<br><br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre" height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("Number").'</td>';
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="right">'.$langs->trans("Number").'</td>';
print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
print '</tr>';
$oldyear=0;

View File

@ -141,7 +141,8 @@ if ($result)
$num = $db->num_rows($result);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($socid) $param.="&socid=".$socid;
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
if ($search_company) $param.="&search_company=".urlencode($search_company);

View File

@ -31,6 +31,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@ -343,6 +344,78 @@ if ($object->id > 0)
print '</table>';
}
/*
* Last supplier proposal
*/
$proposalstatic = new SupplierProposal($db);
if ($user->rights->supplier_proposal->lire)
{
$sql = "SELECT p.rowid, p.ref, p.date_valid as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total as total_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p ";
$sql.= " WHERE p.fk_soc =".$object->id;
$sql.= " AND p.entity =".$conf->entity;
$sql.= " ORDER BY p.date_valid DESC";
$sql.= " ".$db->plimit($MAXLIST);
$resql=$db->query($sql);
if ($resql)
{
$i = 0 ;
$num = $db->num_rows($resql);
if ($num > 0)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">';
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierProposals",($num<$MAXLIST?"":$MAXLIST)).'</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id.'">'.$langs->trans("AllPriceRequests").' <span class="badge">'.$num.'</span></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table>';
print '</td></tr>';
}
$var = True;
while ($i < $num && $i <= $MAXLIST)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td class="nowrap">';
$proposalstatic->id = $obj->rowid;
$proposalstatic->ref = $obj->ref;
$proposalstatic->total_ht = $obj->total_ht;
$proposalstatic->total_tva = $obj->total_tva;
$proposalstatic->total_ttc = $obj->total_ttc;
print $proposalstatic->getNomUrl(1);
print '</td>';
print '<td align="center" width="80">';
if ($obj->dc)
{
print dol_print_date($db->jdate($obj->dc),'day');
}
else
{
print "-";
}
print '</td>';
print '<td align="right" class="nowrap">'.$proposalstatic->LibStatut($obj->fk_statut,5).'</td>';
print '</tr>';
$i++;
}
$db->free($resql);
if ($num >0) print "</table>";
}
else
{
dol_print_error($db);
}
}
/*
* Last supplier orders
@ -441,7 +514,6 @@ if ($object->id > 0)
/*
* Last supplier invoices
*/
$MAXLIST=5;
$langs->load('bills');
$facturestatic = new FactureFournisseur($db);

View File

@ -29,6 +29,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
@ -396,6 +397,7 @@ if ($resql)
$param='';
if ($socid > 0) $param.='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($orderday) $param.='&orderday='.$orderday;
if ($ordermonth) $param.='&ordermonth='.$ordermonth;

View File

@ -1957,7 +1957,7 @@ else
}
else
{
print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'">'.$langs->trans("None").'</td><td></td><td></td></tr>';
print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td></tr>';
}
if ($object->paye == 0)

View File

@ -129,7 +129,7 @@ if ($result)
}
else
{
print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table>';

View File

@ -207,7 +207,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
}
else
{
print '<tr '.$bc[$var].'><td colspan="7">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
}
@ -272,7 +272,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
}
else
{
print '<tr '.$bc[$var].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
}
@ -336,7 +336,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
}
else
{
print '<tr '.$bc[$var].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
}

View File

@ -473,7 +473,7 @@ if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->s
{
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$board=new Account($db);
$nb = $board::countAccountToReconcile();
$nb = $board::countAccountToReconcile(); // Get nb of account to reconciliate
if ($nb > 0)
{
$dashboardlines[] = $board->load_board($user);

View File

@ -64,11 +64,14 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (130, 'fichinter','external', 'BILLING', 'Contact client facturation intervention', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (131, 'fichinter','external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140, 'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141, 'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142, 'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143, 'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145, 'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (150, 'dolresource','internal', 'USERINCHARGE', 'In charge of resource', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (151, 'dolresource','external', 'THIRDINCHARGE', 'In charge of resource', 1);
-- All project code must start with 'PROJECT'
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (160, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1);

View File

@ -39,6 +39,9 @@ ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after dat
ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0;
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (150, 'dolresource','internal', 'USERINCHARGE', 'In charge of resource', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (151, 'dolresource','external', 'THIRDINCHARGE', 'In charge of resource', 1);
-- DROP TABLE llx_product_lot;
CREATE TABLE llx_product_lot (
rowid integer AUTO_INCREMENT PRIMARY KEY,
@ -116,6 +119,7 @@ ALTER TABLE llx_facturedet ADD COLUMN fk_contract_line integer NULL AFTER rang;
ALTER TABLE llx_facturedet_rec ADD COLUMN import_key varchar(14);
ALTER TABLE llx_chargesociales ADD COLUMN import_key varchar(14);
ALTER TABLE llx_tva ADD COLUMN import_key varchar(14);
--DROP TABLE llx_website_page;
--DROP TABLE llx_website;

View File

@ -30,14 +30,7 @@ create table llx_tva
entity integer DEFAULT 1 NOT NULL, -- multi company id
note text,
fk_bank integer,
fk_user_creat integer, -- utilisateur qui a cree l'info
fk_user_modif integer -- utilisateur qui a modifi<66> l'info
fk_user_creat integer, -- utilisateur who create record
fk_user_modif integer, -- utilisateur who modify record
import_key varchar(14)
)ENGINE=innodb;
--
-- List of codes for the field entity
--
-- 1 : first company vat
-- 2 : second company vat
-- 3 : etc...
--

View File

@ -3,9 +3,9 @@ ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file
ACCOUNTING_EXPORT_DATE=Date format for export file
ACCOUNTING_EXPORT_PIECE=Export the number of piece
ACCOUNTING_EXPORT_GLOBAL_ACCOUNT=Export with global account
ACCOUNTING_EXPORT_LABEL=Export the label
ACCOUNTING_EXPORT_AMOUNT=Export the amount
ACCOUNTING_EXPORT_DEVISE=Export the devise
ACCOUNTING_EXPORT_LABEL=Export label
ACCOUNTING_EXPORT_AMOUNT=Export amount
ACCOUNTING_EXPORT_DEVISE=Export currency
Selectformat=Select the format for the file
ACCOUNTING_EXPORT_PREFIX_SPEC=Specify the prefix for the file name
@ -183,4 +183,4 @@ Formula=Formula
## Error
ErrorNoAccountingCategoryForThisCountry=No accounting category are available for this country
ExportNotSupported=The export format setuped is not supported into this page
ExportNotSupported=The export format setuped is not supported into this page

View File

@ -225,5 +225,6 @@ BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry=Based on t
SameCountryCustomersWithVAT=National customers report
BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry=Based on the two first letters of the VAT number being the same as your own company's country code
LinkedFichinter=Link to an intervention
ImportDataset_tax_1=Import social/fiscal taxes
ImportDataset_tax_contrib=Import social/fiscal taxes
ImportDataset_tax_vat=Import vat payments
ErrorBankAccountNotFound=Error: Bank account not found

View File

@ -142,7 +142,7 @@ Update=Update
AddActionToDo=Add event to do
AddActionDone=Add event done
Close=Close
CloseBox=Remove box from your dashboard
CloseBox=Remove widget from your dashboard
Confirm=Confirm
ConfirmSendCardByMail=Do you really want to send content of this card by mail to <b>%s</b> ?
Delete=Delete
@ -611,7 +611,7 @@ RecordsModified=%s records modified
AutomaticCode=Automatic code
NotManaged=Not managed
FeatureDisabled=Feature disabled
MoveBox=Move box %s
MoveBox=Move widget
Offered=Offered
NotEnoughPermissions=You don't have permission for this action
SessionName=Session name

View File

@ -97,7 +97,8 @@ SelectWarehouseForStockDecrease=Choose warehouse to use for stock decrease
SelectWarehouseForStockIncrease=Choose warehouse to use for stock increase
NoStockAction=No stock action
LastWaitingSupplierOrders=Orders waiting for receptions
DesiredStock=Desired minimum stock
DesiredStock=Desired optimal stock
DesiredStockDesc=This stock amount will be the value used to fill the stock by replenishment feature.
DesiredMaxStock=Desired maximum stock
StockToBuy=To order
Replenishment=Replenishment

View File

@ -59,3 +59,5 @@ DefaultModelSupplierProposalClosed=Default template when closing a price request
ListOfSupplierProposal=List of supplier proposal requests
SupplierProposalsToClose=Supplier proposals to close
SupplierProposalsToProcess=Supplier proposals to process
LastSupplierProposals=Last price requests
AllPriceRequests=All requests

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -26,6 +26,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
$langs->load("compta");
$langs->load("bills");
@ -104,19 +106,23 @@ if ($action == 'add' && $user->rights->loan->write)
}
else
{
$object->label = $_POST["label"];
$object->fk_bank = $_POST["accountid"];
$object->capital = $_POST["capital"];
$object->datestart = $datestart;
$object->dateend = $dateend;
$object->nbterm = $_POST["nbterm"];
$object->rate = $_POST["rate"];
$object->note_private = GETPOST('note_private');
$object->note_public = GETPOST('note_public');
$object->label = $_POST["label"];
$object->fk_bank = $_POST["accountid"];
$object->capital = $_POST["capital"];
$object->datestart = $datestart;
$object->dateend = $dateend;
$object->nbterm = $_POST["nbterm"];
$object->rate = $_POST["rate"];
$object->note_private = GETPOST('note_private');
$object->note_public = GETPOST('note_public');
$object->account_capital = $_POST["accountancy_account_capital"];
$object->account_insurance = $_POST["accountancy_account_insurance"];
$object->account_interest = $_POST["accountancy_account_interest"];
$accountancy_account_capital = GETPOST('accountancy_account_capital');
$accountancy_account_insurance = GETPOST('accountancy_account_insurance');
$accountancy_account_interest = GETPOST('accountancy_account_interest');
if ($accountancy_account_capital <= 0) { $object->account_capital = ''; } else { $object->account_capital = $accountancy_account_capital; }
if ($accountancy_account_insurance <= 0) { $object->account_insurance = ''; } else { $object->account_insurance = $accountancy_account_insurance; }
if ($accountancy_account_interest <= 0) { $object->account_interest = ''; } else { $object->account_interest = $accountancy_account_interest; }
$id=$object->create($user);
if ($id <= 0)
@ -172,6 +178,7 @@ else if ($action == 'update' && $user->rights->loan->write)
*/
$form = new Form($db);
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
$help_url='EN:Module_Loan|FR:Module_Emprunt';
llxHeader("",$langs->trans("Loan"),$help_url);
@ -253,27 +260,50 @@ if ($action == 'create')
print '</table>';
print '<br>';
print '<table class="border" width="100%">';
// Accountancy
if ($conf->accounting->enabled)
if (! empty($conf->accounting->enabled))
{
print '<br>';
print '<table class="border" width="100%">';
// Accountancy_account_capital
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("LoanAccountancyCapitalCode").'</td>';
print '<td>';
print $formaccountancy->select_account($object->accountancy_account_capital, 'accountancy_account_capital', 1, '', 0, 1);
print '</td></tr>';
// Accountancy_account_insurance
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("LoanAccountancyInsuranceCode").'</td>';
print '<td>';
print $formaccountancy->select_account($object->accountancy_account_insurance, 'accountancy_account_insurance', 1, '', 0, 1);
print '</td></tr>';
// Accountancy_account_interest
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("LoanAccountancyInterestCode").'</td>';
print '<td>';
print $formaccountancy->select_account($object->accountancy_account_interest, 'accountancy_account_interest', 1, '', 0, 1);
print '</td></tr>';
}
else // For external software
{
// Accountancy_account_capital
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("LoanAccountancyCapitalCode").'</td>';
print '<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.'">';
print '</td></tr>';
// Accountancy_account_insurance
print '<tr><td class="fieldrequired">'.$langs->trans("LoanAccountancyInsuranceCode").'</td>';
print '<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.'">';
print '</td></tr>';
// Accountancy_account_interest
print '<tr><td class="fieldrequired">'.$langs->trans("LoanAccountancyInterestCode").'</td>';
print '<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.'">';
print '</td></tr>';
print '</table>';
}
print '</table>';
dol_fiche_end();
@ -375,6 +405,39 @@ if ($id > 0)
// Note Public
print '<tr><td>'.$langs->trans('NotePublic').'</td><td>'.nl2br($object->note_public).'</td></tr>';
// Accountancy account capital
print '<tr><td class="nowrap">';
print $langs->trans("LoanAccountancyCapitalCode");
print '</td><td>';
if (! empty($conf->accounting->enabled)) {
print length_accountg($object->account_capital);
} else {
print $object->account_capital;
}
print '</td></tr>';
// Accountancy account insurance
print '<tr><td class="nowrap">';
print $langs->trans("LoanAccountancyInsuranceCode");
print '</td><td>';
if (! empty($conf->accounting->enabled)) {
print length_accountg($object->account_insurance);
} else {
print $object->account_insurance;
}
print '</td></tr>';
// Accountancy account interest
print '<tr><td class="nowrap">';
print $langs->trans("LoanAccountancyInterestCode");
print '</td><td>';
if (! empty($conf->accounting->enabled)) {
print length_accountg($object->account_interest);
} else {
print $object->account_interest;
}
print '</td></tr>';
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
@ -444,13 +507,11 @@ if ($id > 0)
print '<td align="right">'.price($objp->amount_interest, 0, $langs, 0, 0, -1, $conf->currency)."</td>\n";
print '<td align="right">'.price($objp->amount_capital, 0, $langs, 0, 0, -1, $conf->currency)."</td>\n";
print "</tr>";
$total_insurance += $objp->amount_insurance;
$total_interest += $objp->amount_interest;
$total_capital += $objp->amount_capital;
$i++;
}
$totalpaid = $total_insurance + $total_interest + $total_capital;
$totalpaid = $total_capital;
if ($object->paid == 0)
{

View File

@ -72,7 +72,7 @@ class Loan extends CommonObject
function fetch($id)
{
$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.nbterm, l.rate, l.note_private, l.note_public,";
$sql.= " l.paid";
$sql.= " l.paid, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest";
$sql.= " FROM ".MAIN_DB_PREFIX."loan as l";
$sql.= " WHERE l.rowid = ".$id;
@ -84,17 +84,22 @@ class Loan extends CommonObject
{
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->datestart = $this->db->jdate($obj->datestart);
$this->dateend = $this->db->jdate($obj->dateend);
$this->label = $obj->label;
$this->capital = $obj->capital;
$this->nbterm = $obj->nbterm;
$this->rate = $obj->rate;
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->paid = $obj->paid;
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->datestart = $this->db->jdate($obj->datestart);
$this->dateend = $this->db->jdate($obj->dateend);
$this->label = $obj->label;
$this->capital = $obj->capital;
$this->nbterm = $obj->nbterm;
$this->rate = $obj->rate;
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->paid = $obj->paid;
$this->account_capital = $obj->accountancy_account_capital;
$this->account_insurance = $obj->accountancy_account_insurance;
$this->account_interest = $obj->accountancy_account_interest;
return 1;
}

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Laurent Destailleur <jmenent@2byte.es>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -104,6 +104,7 @@ if ($resql)
$var=true;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_ref) $param.="&amp;search_ref=".$search_ref;
if ($search_label) $param.="&amp;search_label=".$search_user;

View File

@ -56,7 +56,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
$form = new Form($db);
llxHeader('',$langs->trans("LoanArea"),'');
llxHeader('',$langs->trans("Loan"),'');
if ($id > 0)
{

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -138,7 +138,7 @@ if ($action == 'add_payment')
}
}
$_GET["action"]='create';
$action = 'create';
}
@ -152,12 +152,11 @@ $form=new Form($db);
// Form to create loan's payment
if ($_GET["action"] == 'create')
if ($action == 'create')
{
$total = $loan->capital;
print load_fiche_titre($langs->trans("DoPayment"));
print "<br>\n";
print '<form name="add_payment" action="'.$_SERVER['PHP_SELF'].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -165,6 +164,8 @@ if ($_GET["action"] == 'create')
print '<input type="hidden" name="chid" value="'.$chid.'">';
print '<input type="hidden" name="action" value="add_payment">';
dol_fiche_head();
print '<table cellspacing="0" class="border" width="100%" cellpadding="2">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Loan").'</td>';
@ -230,9 +231,10 @@ if ($_GET["action"] == 'create')
print '<td valign="top">'.$langs->trans("NotePublic").'</td>';
print '<td valign="top" colspan="2"><textarea name="note_public" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
print '</tr>';
print '</table>';
print '<br>';
dol_fiche_end();
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -296,13 +298,11 @@ if ($_GET["action"] == 'create')
print '</table>';
print '<br><center>';
print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp; &nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center>';
print '</div>';
print "</form>\n";
}

View File

@ -131,7 +131,7 @@ class Product extends CommonObject
var $status_buy;
// Statut indique si le produit est un produit fini '1' ou une matiere premiere '0'
var $finished;
// We must manage batch number, sell-by date and so on : '1':yes '0':no
// We must manage lot/batch number, sell-by date and so on : '1':yes '0':no
var $status_batch;
var $customcode; // Customs code
@ -879,9 +879,10 @@ class Product extends CommonObject
* Delete a product from database (if not used)
*
* @param int $id Product id (usage of this is deprecated, delete should be called without parameters on a fetched object)
* @param int $notrigger Do not execute trigger
* @return int < 0 if KO, 0 = Not possible, > 0 if OK
*/
function delete($id=0)
function delete($id=0, $notrigger=0)
{
// Deprecation warning
if ($id > 0) {
@ -914,7 +915,7 @@ class Product extends CommonObject
{
$this->db->begin();
if (! $error)
if (! $error && empty($notrigger))
{
// Call trigger
$result=$this->call_trigger('PRODUCT_DELETE',$user);

View File

@ -283,7 +283,7 @@ if ($id > 0 || ! empty($ref))
else
{
print '<tr class="impair">';
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}
print '</table>';
@ -454,7 +454,7 @@ if ($id > 0 || ! empty($ref))
if (! empty($conf->stock->enabled)) $colspan++;
print '<tr class="impair">';
print '<td colspan="'.$colspan.'">'.$langs->trans("None").'</td>';
print '<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td>';
print '</tr>';
}

View File

@ -73,7 +73,8 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC";
$contextpage='productservicelist';
// Initialize context for list
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'productservicelist';
if ($type === '1') { $contextpage='servicelist'; if ($search_type=='') $search_type='1'; }
if ($type === '0') { $contextpage='productlist'; if ($search_type=='') $search_type='0'; }
@ -334,7 +335,8 @@ else
}
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_categ > 0) $param.="&amp;search_categ=".$search_categ;
if ($sref) $param="&amp;sref=".$sref;
if ($search_ref_supplier) $param="&amp;search_ref_supplier=".$search_ref_supplier;

View File

@ -126,7 +126,6 @@ class MouvementStock extends CommonObject
return -2;
}
// FIXME Code not complete to implement this
// Check table llx_product_lot from batchnumber for same product
// If found and eatby/sellby defined into table and provided and differs, return error
// If found and eatby/sellby defined into table and not provided, we take value from table
@ -218,7 +217,7 @@ class MouvementStock extends CommonObject
$i++;
}
}
else
else // If not found, we add record
{
$productlot = new Productlot($this->db);
$productlot->fk_product = $fk_product;

View File

@ -108,7 +108,8 @@ if ($result)
llxHeader("",$langs->trans("ListOfWarehouses"),$help_url);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -66,7 +66,29 @@ if (! $sortorder) $sortorder="DESC";
$pdluoid=GETPOST('pdluoid','int');
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
// Initialize context for list
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'movementlist';
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array($contextpage));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('movement');
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
/*
* Actions
*/
if ($cancel) $action=''; // Protection to avoid action for all cancel buttons
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$year='';
$month='';
@ -77,15 +99,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_user="";
$search_batch="";
$sall="";
$search_array_options=array();
}
/*
* Actions
*/
if ($cancel) $action=''; // Protection to avoid action for all cancel buttons
// Correct stock
if ($action == "correct_stock")
{
@ -344,10 +360,7 @@ $sql.= " WHERE m.fk_product = p.rowid";
$sql.= " AND m.fk_entrepot = e.rowid";
$sql.= " AND e.entity IN (".getEntity('stock', 1).")";
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0";
if ($id)
{
$sql.= " AND e.rowid ='".$id."'";
}
if ($id > 0) $sql.= " AND e.rowid ='".$id."'";
if ($month > 0)
{
if ($year > 0)
@ -359,17 +372,14 @@ else if ($year > 0)
{
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
if ($idproduct > 0)
{
$sql.= " AND p.rowid = '".$idproduct."'";
}
if (! empty($search_movement)) $sql.= " AND m.label LIKE '%".$db->escape($search_movement)."%'";
if (! empty($search_inventorycode)) $sql.= " AND m.inventorycode LIKE '%".$db->escape($search_inventorycode)."%'";
if (! empty($search_product_ref)) $sql.= " AND p.ref LIKE '%".$db->escape($search_product_ref)."%'";
if (! empty($search_product)) $sql.= " AND p.label LIKE '%".$db->escape($search_product)."%'";
if (! empty($search_warehouse)) $sql.= " AND e.rowid = '".$db->escape($search_warehouse)."'";
if (! empty($search_user)) $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'";
if (! empty($search_batch)) $sql.= " AND m.batch LIKE '%".$db->escape($search_batch)."%'";
if ($idproduct > 0) $sql.= " AND p.rowid = '".$idproduct."'";
if (! empty($search_movement)) $sql.= natural_search('m.label', $search_movement);
if (! empty($search_inventorycode)) $sql.= natural_search('m.inventorycode', $search_inventorycode);
if (! empty($search_product_ref)) $sql.= natural_search('p.ref', $search_product_ref);
if (! empty($search_product)) $sql.= natural_search('p.label', $search_product);
if ($search_warehouse > 0) $sql.= " AND e.rowid = '".$db->escape($search_warehouse)."'";
if (! empty($search_user)) $sql.= natural_search('u.login', $search_user);
if (! empty($search_batch)) $sql.= natural_search('m.batch', $search_batch);
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -553,22 +563,40 @@ if ($resql)
$param='';
if ($id > 0) $param.='&id='.$id;
if ($search_movement) $param.='&search_movement='.urlencode($search_movement);
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($id > 0) $param.='&id='.$id;
if ($search_movement) $param.='&search_movement='.urlencode($search_movement);
if ($search_inventorycode) $param.='&search_inventorycode='.urlencode($search_inventorycode);
if ($search_product_ref) $param.='&search_product_ref='.urlencode($search_product_ref);
if ($search_product) $param.='&search_product='.urlencode($search_product);
if ($search_warehouse) $param.='&search_warehouse='.urlencode($search_warehouse);
if (!empty($sref)) $param.='&sref='.urlencode($sref); // FIXME $sref is not defined
if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined
if ($search_user) $param.='&search_user='.urlencode($search_user);
if ($idproduct > 0) $param.='&idproduct='.$idproduct;
if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords,'');
else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords);
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
if ($search_product_ref) $param.='&search_product_ref='.urlencode($search_product_ref);
if ($search_product) $param.='&search_product='.urlencode($search_product);
if ($search_warehouse > 0) $param.='&search_warehouse='.urlencode($search_warehouse);
if (!empty($sref)) $param.='&sref='.urlencode($sref); // FIXME $sref is not defined
if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined
if ($search_user) $param.='&search_user='.urlencode($search_user);
if ($idproduct > 0) $param.='&idproduct='.$idproduct;
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{
$crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
if ($id > 0) print '<input type="hidden" name="id" value="'.$id.'">';
if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords, '', 0, '', '', $limit);
else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit);
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
//print_liste_field_titre($langs->trans("Id"),$_SERVER["PHP_SELF"], "m.rowid","",$param,"",$sortfield,$sortorder);
@ -586,8 +614,9 @@ if ($resql)
print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("InventoryCodeShort"),$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LabelMovement"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Units"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("");
print "</tr>\n";
// Lignes des champs de filtre
@ -639,17 +668,21 @@ if ($resql)
print '<td class="liste_titre" align="left">';
print '&nbsp; ';
print '</td>';
// Qty
print '<td class="liste_titre" align="left">';
print '&nbsp; ';
print '</td>';
// Actions
print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
$searchpitco=$form->showFilterAndCheckAddButtons(0);
print $searchpitco;
print '</td>';
print "</tr>\n";
$arrayofuniqueproduct=array();
$var=True;
while ($i < min($num,$conf->liste_limit))
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
@ -716,6 +749,9 @@ if ($resql)
print '<td align="right">';
if ($objp->value > 0) print '+';
print $objp->value.'</td>';
print '<td></td>';
print "</tr>\n";
$i++;
}

View File

@ -490,7 +490,8 @@ if ($id > 0 || $ref)
print '</td></tr>';
// Desired stock
print '<tr><td>'.$form->editfieldkey("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer).'</td><td colspan="2">';
print '<tr><td>'.$form->editfieldkey($form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1),'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer);
print '</td><td colspan="2">';
print $form->editfieldval("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer);
print '</td></tr>';
@ -503,7 +504,7 @@ if ($id > 0 || $ref)
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'<br>':'');
print '<tr><td>';
print $form->textwithtooltip($langs->trans("PhysicalStock"), $text_stock_options, 2, 1, img_picto('', 'info'), '', 2);
print $form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1);
print '</td>';
print '<td>'.$object->stock_reel;
if ($object->seuil_stock_alerte != '' && ($object->stock_reel < $object->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit"));

View File

@ -305,16 +305,14 @@ if ($resql)
$num = $db->num_rows($resql);
$params='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_entity != '') $params.= '&amp;search_entity='.urlencode($search_entity);
if ($search_fk_product != '') $params.= '&amp;search_fk_product='.urlencode($search_fk_product);
if ($search_batch != '') $params.= '&amp;search_batch='.urlencode($search_batch);
if ($search_fk_user_creat != '') $params.= '&amp;search_fk_user_creat='.urlencode($search_fk_user_creat);
if ($search_fk_user_modif != '') $params.= '&amp;search_fk_user_modif='.urlencode($search_fk_user_modif);
if ($search_import_key != '') $params.= '&amp;search_import_key='.urlencode($search_import_key);
if ($search_entity != '') $params.= '&amp;search_entity='.urlencode($search_entity);
if ($search_fk_product != '') $params.= '&amp;search_fk_product='.urlencode($search_fk_product);
if ($search_batch != '') $params.= '&amp;search_batch='.urlencode($search_batch);
if ($search_fk_user_creat != '') $params.= '&amp;search_fk_user_creat='.urlencode($search_fk_user_creat);
if ($search_fk_user_modif != '') $params.= '&amp;search_fk_user_modif='.urlencode($search_fk_user_modif);
if ($search_import_key != '') $params.= '&amp;search_import_key='.urlencode($search_import_key);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
foreach ($search_array_options as $key => $val)

View File

@ -1627,8 +1627,8 @@ class Project extends CommonObject
$response = new WorkboardResponse();
$response->warning_delay = $conf->projet->warning_delay/60/60/24;
$response->label = $langs->trans("OpenedProjects");
if ($user->rights->projet->all->lire) $response->url = DOL_URL_ROOT.'/projet/index.php?search_status=1&mainmenu=project';
else $response->url = DOL_URL_ROOT.'/projet/index.php?mode=mine&search_status=1&mainmenu=project';
if ($user->rights->projet->all->lire) $response->url = DOL_URL_ROOT.'/projet/list.php?search_status=1&mainmenu=project';
else $response->url = DOL_URL_ROOT.'/projet/list.php?mode=mine&search_status=1&mainmenu=project';
$response->img = img_object($langs->trans("Projects"),"project");
// This assignment in condition is not a bug. It allows walking the results.
@ -1719,9 +1719,8 @@ class Project extends CommonObject
{
global $conf;
if (! ($this->statut == 1)) {
return false;
}
if (! ($this->statut == 1)) return false;
if (! $this->datee) return false;
$now = dol_now();

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