Uniformize code
This commit is contained in:
parent
5f07c18e06
commit
ae5b779652
@ -70,7 +70,7 @@ $hookmanager->initHooks(array('admin'));
|
|||||||
// Put here declaration of dictionaries properties
|
// Put here declaration of dictionaries properties
|
||||||
|
|
||||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,0,25,0,26);
|
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,0,25,0,26);
|
||||||
|
|
||||||
// Name of SQL tables of dictionaries
|
// Name of SQL tables of dictionaries
|
||||||
$tabname=array();
|
$tabname=array();
|
||||||
@ -102,6 +102,7 @@ $tabname[25]= MAIN_DB_PREFIX."c_email_templates";
|
|||||||
$tabname[26]= MAIN_DB_PREFIX."c_units";
|
$tabname[26]= MAIN_DB_PREFIX."c_units";
|
||||||
$tabname[27]= MAIN_DB_PREFIX."c_stcomm";
|
$tabname[27]= MAIN_DB_PREFIX."c_stcomm";
|
||||||
$tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
|
$tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
|
||||||
|
$tabname[29]= MAIN_DB_PREFIX."c_lead_status";
|
||||||
|
|
||||||
// Dictionary labels
|
// Dictionary labels
|
||||||
$tablib=array();
|
$tablib=array();
|
||||||
@ -133,6 +134,7 @@ $tablib[25]= "DictionaryEMailTemplates";
|
|||||||
$tablib[26]= "DictionaryUnits";
|
$tablib[26]= "DictionaryUnits";
|
||||||
$tablib[27]= "DictionaryProspectStatus";
|
$tablib[27]= "DictionaryProspectStatus";
|
||||||
$tablib[28]= "DictionaryHolidayTypes";
|
$tablib[28]= "DictionaryHolidayTypes";
|
||||||
|
$tablib[29]= "DictionaryOpportunityStatus";
|
||||||
|
|
||||||
// Requests to extract data
|
// Requests to extract data
|
||||||
$tabsql=array();
|
$tabsql=array();
|
||||||
@ -164,6 +166,7 @@ $tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position,
|
|||||||
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||||
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||||
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||||
|
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||||
|
|
||||||
// Criteria to sort dictionaries
|
// Criteria to sort dictionaries
|
||||||
$tabsqlsort=array();
|
$tabsqlsort=array();
|
||||||
@ -195,6 +198,7 @@ $tabsqlsort[25]="label ASC";
|
|||||||
$tabsqlsort[26]="code ASC";
|
$tabsqlsort[26]="code ASC";
|
||||||
$tabsqlsort[27]="code ASC";
|
$tabsqlsort[27]="code ASC";
|
||||||
$tabsqlsort[28]="country ASC, code ASC";
|
$tabsqlsort[28]="country ASC, code ASC";
|
||||||
|
$tabsqlsort[29]="position ASC";
|
||||||
|
|
||||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||||
$tabfield=array();
|
$tabfield=array();
|
||||||
@ -226,6 +230,7 @@ $tabfield[25]= "label,type_template,private,position,topic,content";
|
|||||||
$tabfield[26]= "code,label,short_label";
|
$tabfield[26]= "code,label,short_label";
|
||||||
$tabfield[27]= "code,libelle";
|
$tabfield[27]= "code,libelle";
|
||||||
$tabfield[28]= "code,label,delay,newByMonth,country_id,country";
|
$tabfield[28]= "code,label,delay,newByMonth,country_id,country";
|
||||||
|
$tabfield[29]= "code,label,percent,position";
|
||||||
|
|
||||||
// Nom des champs d'edition pour modification d'un enregistrement
|
// Nom des champs d'edition pour modification d'un enregistrement
|
||||||
$tabfieldvalue=array();
|
$tabfieldvalue=array();
|
||||||
@ -257,6 +262,7 @@ $tabfieldvalue[25]= "label,type_template,private,position,topic,content";
|
|||||||
$tabfieldvalue[26]= "code,label,short_label";
|
$tabfieldvalue[26]= "code,label,short_label";
|
||||||
$tabfieldvalue[27]= "code,libelle";
|
$tabfieldvalue[27]= "code,libelle";
|
||||||
$tabfieldvalue[28]= "code,label,delay,newByMonth,country";
|
$tabfieldvalue[28]= "code,label,delay,newByMonth,country";
|
||||||
|
$tabfieldvalue[29]= "code,label,percent,position";
|
||||||
|
|
||||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||||
$tabfieldinsert=array();
|
$tabfieldinsert=array();
|
||||||
@ -288,6 +294,7 @@ $tabfieldinsert[25]= "label,type_template,private,position,topic,content";
|
|||||||
$tabfieldinsert[26]= "code,label,short_label";
|
$tabfieldinsert[26]= "code,label,short_label";
|
||||||
$tabfieldinsert[27]= "code,libelle";
|
$tabfieldinsert[27]= "code,libelle";
|
||||||
$tabfieldinsert[28]= "code,label,delay,newByMonth,fk_country";
|
$tabfieldinsert[28]= "code,label,delay,newByMonth,fk_country";
|
||||||
|
$tabfieldinsert[29]= "code,label,percent,position";
|
||||||
|
|
||||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||||
// Example: "" if id field is "rowid" and has autoincrement on
|
// Example: "" if id field is "rowid" and has autoincrement on
|
||||||
@ -321,6 +328,7 @@ $tabrowid[25]= "";
|
|||||||
$tabrowid[26]= "";
|
$tabrowid[26]= "";
|
||||||
$tabrowid[27]= "id";
|
$tabrowid[27]= "id";
|
||||||
$tabrowid[28]= "";
|
$tabrowid[28]= "";
|
||||||
|
$tabrowid[29]= "";
|
||||||
|
|
||||||
// Condition to show dictionary in setup page
|
// Condition to show dictionary in setup page
|
||||||
$tabcond=array();
|
$tabcond=array();
|
||||||
@ -352,6 +360,7 @@ $tabcond[25]= true; // && ! empty($conf->global->MAIN_EMAIL_EDIT_TEMPLATE_FROM_D
|
|||||||
$tabcond[26]= ! empty($conf->product->enabled);
|
$tabcond[26]= ! empty($conf->product->enabled);
|
||||||
$tabcond[27]= ! empty($conf->societe->enabled);
|
$tabcond[27]= ! empty($conf->societe->enabled);
|
||||||
$tabcond[28]= ! empty($conf->holiday->enabled);
|
$tabcond[28]= ! empty($conf->holiday->enabled);
|
||||||
|
$tabcond[29]= ! empty($conf->projet->enabled);
|
||||||
|
|
||||||
// List of help for fields
|
// List of help for fields
|
||||||
$tabhelp=array();
|
$tabhelp=array();
|
||||||
@ -383,6 +392,7 @@ $tabhelp[25] = array();
|
|||||||
$tabhelp[26] = array();
|
$tabhelp[26] = array();
|
||||||
$tabhelp[27] = array();
|
$tabhelp[27] = array();
|
||||||
$tabhelp[28] = array();
|
$tabhelp[28] = array();
|
||||||
|
$tabhelp[29] = array();
|
||||||
|
|
||||||
// List of check for fields (NOT USED YET)
|
// List of check for fields (NOT USED YET)
|
||||||
$tabfieldcheck=array();
|
$tabfieldcheck=array();
|
||||||
@ -414,6 +424,7 @@ $tabfieldcheck[25] = array();
|
|||||||
$tabfieldcheck[26] = array();
|
$tabfieldcheck[26] = array();
|
||||||
$tabfieldcheck[27] = array();
|
$tabfieldcheck[27] = array();
|
||||||
$tabfieldcheck[28] = array();
|
$tabfieldcheck[28] = array();
|
||||||
|
$tabfieldcheck[29] = array();
|
||||||
|
|
||||||
// Complete all arrays with entries found into modules
|
// Complete all arrays with entries found into modules
|
||||||
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
||||||
|
|||||||
@ -992,7 +992,7 @@ if ($id > 0)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Contact
|
// Contact
|
||||||
print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
|
print '<td>'.$langs->trans("Contact").'</td><td>';
|
||||||
$form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200');
|
$form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -1065,7 +1065,7 @@ if ($id > 0)
|
|||||||
if($action == 'clone')
|
if($action == 'clone')
|
||||||
{
|
{
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneAction', $object->label), 'confirm_clone', $formquestion, 'yes', 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneAction', $object->label), 'confirm_clone', $formquestion, 'yes', 1);
|
||||||
|
|
||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1275,7 +1275,7 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Modify").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Modify").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->agenda->allactions->create ||
|
if ($user->rights->agenda->allactions->create ||
|
||||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
||||||
{
|
{
|
||||||
@ -1285,7 +1285,7 @@ if ($id > 0)
|
|||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("ToClone").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("ToClone").'</a></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->agenda->allactions->delete ||
|
if ($user->rights->agenda->allactions->delete ||
|
||||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete))
|
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -55,7 +55,7 @@ $search_zipcode=GETPOST("search_zipcode");
|
|||||||
$search_town=GETPOST("search_town");
|
$search_town=GETPOST("search_town");
|
||||||
$search_code=GETPOST("search_code");
|
$search_code=GETPOST("search_code");
|
||||||
$search_compta=GETPOST("search_compta");
|
$search_compta=GETPOST("search_compta");
|
||||||
$search_status = GETPOST("search_status",'int');
|
$search_status= GETPOST("search_status",'int');
|
||||||
|
|
||||||
// Load sale and categ filters
|
// Load sale and categ filters
|
||||||
$search_sale = GETPOST("search_sale",'int');
|
$search_sale = GETPOST("search_sale",'int');
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class FormOrder
|
|||||||
print '<select class="flat" name="'.$htmlname.'">';
|
print '<select class="flat" name="'.$htmlname.'">';
|
||||||
if ($addempty) print '<option value="-1" selected> </option>';
|
if ($addempty) print '<option value="-1" selected> </option>';
|
||||||
|
|
||||||
// TODO Use a table called llx_c_input_reason
|
// TODO Use the table called llx_c_input_reason
|
||||||
print '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans('OrderSource0').'</option>';
|
print '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans('OrderSource0').'</option>';
|
||||||
print '<option value="1"'.($selected=='1'?' selected':'').'>'.$langs->trans('OrderSource1').'</option>';
|
print '<option value="1"'.($selected=='1'?' selected':'').'>'.$langs->trans('OrderSource1').'</option>';
|
||||||
print '<option value="2"'.($selected=='2'?' selected':'').'>'.$langs->trans('OrderSource2').'</option>';
|
print '<option value="2"'.($selected=='2'?' selected':'').'>'.$langs->trans('OrderSource2').'</option>';
|
||||||
@ -109,9 +109,9 @@ class FormOrder
|
|||||||
global $conf,$langs,$form;
|
global $conf,$langs,$form;
|
||||||
|
|
||||||
if (! is_object($form)) $form=new Form($this->db);
|
if (! is_object($form)) $form=new Form($this->db);
|
||||||
|
|
||||||
$listofmethods=array();
|
$listofmethods=array();
|
||||||
|
|
||||||
$sql = "SELECT rowid, code, libelle as label";
|
$sql = "SELECT rowid, code, libelle as label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_input_method";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_input_method";
|
||||||
$sql.= " WHERE active = 1";
|
$sql.= " WHERE active = 1";
|
||||||
|
|||||||
@ -414,32 +414,36 @@ class FormProjets
|
|||||||
* Build a HTML select list of element of same thirdparty to suggest to link them to project
|
* Build a HTML select list of element of same thirdparty to suggest to link them to project
|
||||||
*
|
*
|
||||||
* @param string $table_element Table of the element to update
|
* @param string $table_element Table of the element to update
|
||||||
* @param int $socid socid to filter
|
* @param int $socid If of thirdparty to use as filter
|
||||||
|
* @param string $morecss More CSS
|
||||||
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
||||||
*/
|
*/
|
||||||
function select_element($table_element,$socid=0)
|
function select_element($table_element,$socid=0,$morecss='')
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
|
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
|
||||||
|
|
||||||
|
$linkedtothirdparty=false;
|
||||||
|
if (! in_array($table_element, array('don','expensereport_det','expensereport'))) $linkedtothirdparty=true;
|
||||||
|
|
||||||
$projectkey="fk_projet";
|
$projectkey="fk_projet";
|
||||||
switch ($table_element)
|
switch ($table_element)
|
||||||
{
|
{
|
||||||
case "facture":
|
case "facture":
|
||||||
$sql = "SELECT rowid, facnumber as ref";
|
$sql = "SELECT t.rowid, t.facnumber as ref";
|
||||||
break;
|
break;
|
||||||
case "facture_fourn":
|
case "facture_fourn":
|
||||||
$sql = "SELECT rowid, ref, ref_supplier";
|
$sql = "SELECT t.rowid, t.ref, t.ref_supplier";
|
||||||
break;
|
break;
|
||||||
case "commande_fourn":
|
case "commande_fourn":
|
||||||
$sql = "SELECT rowid, ref, ref_supplier";
|
$sql = "SELECT t.rowid, t.ref, t.ref_supplier";
|
||||||
break;
|
break;
|
||||||
case "facture_rec":
|
case "facture_rec":
|
||||||
$sql = "SELECT rowid, titre as ref";
|
$sql = "SELECT t.rowid, t.titre as ref";
|
||||||
break;
|
break;
|
||||||
case "actioncomm":
|
case "actioncomm":
|
||||||
$sql = "SELECT id as rowid, label as ref";
|
$sql = "SELECT t.id as rowid, t.label as ref";
|
||||||
$projectkey="fk_project";
|
$projectkey="fk_project";
|
||||||
break;
|
break;
|
||||||
case "expensereport_det":
|
case "expensereport_det":
|
||||||
@ -448,14 +452,16 @@ class FormProjets
|
|||||||
$projectkey="fk_projet";
|
$projectkey="fk_projet";
|
||||||
break;*/
|
break;*/
|
||||||
default:
|
default:
|
||||||
$sql = "SELECT rowid, ref";
|
$sql = "SELECT t.rowid, t.ref";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if ($linkedtothirdparty) $sql.=", s.nom as name";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$table_element." as t";
|
||||||
|
if ($linkedtothirdparty) $sql.=", ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= " WHERE ".$projectkey." is null";
|
$sql.= " WHERE ".$projectkey." is null";
|
||||||
if (! empty($socid) && ! in_array($table_element, array('don'))) $sql.= " AND fk_soc=".$socid;
|
if (! empty($socid) && $linkedtothirdparty) $sql.= " AND t.fk_soc=".$socid;
|
||||||
if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND entity='.getEntity('project');
|
if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND t.entity='.getEntity('project');
|
||||||
|
if ($linkedtothirdparty) $sql.=" AND s.rowid = t.fk_soc";
|
||||||
$sql.= " ORDER BY ref DESC";
|
$sql.= " ORDER BY ref DESC";
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
|
dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
|
||||||
@ -467,12 +473,14 @@ class FormProjets
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$sellist = '<select class="flat elementselect" name="elementselect">';
|
$sellist = '<select class="flat elementselect css'.$table_element.($morecss?' '.$morecss:'').'" name="elementselect">';
|
||||||
|
$sellist .='<option value="-1"></option>';
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$ref=$obj->ref?$obj->ref:$obj->rowid;
|
$ref=$obj->ref?$obj->ref:$obj->rowid;
|
||||||
if (! empty($obj->ref_supplier)) $ref.=' ('.$obj->ref_supplier.')';
|
if (! empty($obj->ref_supplier)) $ref.=' ('.$obj->ref_supplier.')';
|
||||||
|
if (! empty($obj->name)) $ref.=' - '.$obj->name;
|
||||||
$sellist .='<option value="'.$obj->rowid.'">'.$ref.'</option>';
|
$sellist .='<option value="'.$obj->rowid.'">'.$ref.'</option>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -490,6 +498,7 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
$this->errors[]=$this->db->lasterror();
|
$this->errors[]=$this->db->lasterror();
|
||||||
dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
|
dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
|
||||||
@ -503,15 +512,18 @@ class FormProjets
|
|||||||
*
|
*
|
||||||
* @param string $htmlname HTML name
|
* @param string $htmlname HTML name
|
||||||
* @param int $preselected Preselected
|
* @param int $preselected Preselected
|
||||||
|
* @param int $shwoempty Add an empty line
|
||||||
|
* @param int $useshortlabel Use short label
|
||||||
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
||||||
*/
|
*/
|
||||||
function selectOpportunityStatus($htmlname,$preselected=0)
|
function selectOpportunityStatus($htmlname,$preselected=0,$showempty=1,$useshortlabel=0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$sql = "SELECT rowid, ref";
|
$sql = "SELECT rowid, code, label, percent";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_lead_status';
|
$sql.= " FROM ".MAIN_DB_PREFIX.'c_lead_status';
|
||||||
$sql.= " ORDER BY ref DESC";
|
$sql.= " WHERE active = 1";
|
||||||
|
$sql.= " ORDER BY position";
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::selectOpportunityStatus', LOG_DEBUG);
|
dol_syslog(get_class($this).'::selectOpportunityStatus', LOG_DEBUG);
|
||||||
|
|
||||||
@ -522,12 +534,26 @@ class FormProjets
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$sellist = '<select class="flat" name="'.$htmlname.'">';
|
$sellist = '<select class="flat oppstatus" name="'.$htmlname.'">';
|
||||||
|
if ($showempty) $sellist.= '<option value="-1"></option>';
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$sellist .='<option value="'.$obj->rowid.'">'.$ref.'</option>';
|
$sellist .='<option value="'.$obj->rowid.'"';
|
||||||
|
if ($obj->rowid == $preselected) $sellist .= ' selected="selected"';
|
||||||
|
$sellist .= '>';
|
||||||
|
if ($useshortlabel)
|
||||||
|
{
|
||||||
|
$finallabel = ($langs->transnoentitiesnoconv("OppStatusShort".$obj->code) != "OppStatusShort".$obj->code ? $langs->transnoentitiesnoconv("OppStatusShort".$obj->code) : $obj->label);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
|
||||||
|
$finallabel.= ' ('.$obj->percent.'%)';
|
||||||
|
}
|
||||||
|
$sellist .= $finallabel;
|
||||||
|
$sellist .='</option>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$sellist .='</select>';
|
$sellist .='</select>';
|
||||||
|
|||||||
@ -337,8 +337,8 @@ class Translate
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return translated value of key. Search in lang file, then into database.
|
* Return translated value of key for special keys ("Currency...", "Civility...", ...).
|
||||||
* Key must be any complete entry into lang file: CurrencyEUR, ...
|
* Search in lang file, then into database. Key must be any complete entry into lang file: CurrencyEUR, ...
|
||||||
* If not found, return key.
|
* If not found, return key.
|
||||||
* The string return is not formated (translated with transnoentitiesnoconv)
|
* The string return is not formated (translated with transnoentitiesnoconv)
|
||||||
* NOTE: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), if you modify this function,
|
* NOTE: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), if you modify this function,
|
||||||
@ -354,25 +354,33 @@ class Translate
|
|||||||
if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
|
if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
|
||||||
|
|
||||||
$newstr=$key;
|
$newstr=$key;
|
||||||
if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
|
if (preg_match('/^Civility([0-9A-Z]+)$/i',$key,$reg))
|
||||||
{
|
|
||||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','label');
|
|
||||||
}
|
|
||||||
else if (preg_match('/^SendingMethod([0-9A-Z]+)$/i',$key,$reg))
|
|
||||||
{
|
|
||||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_shipment_mode','code','libelle');
|
|
||||||
}
|
|
||||||
else if (preg_match('/^PaymentTypeShort([0-9A-Z]+)$/i',$key,$reg))
|
|
||||||
{
|
|
||||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle');
|
|
||||||
}
|
|
||||||
else if (preg_match('/^Civility([0-9A-Z]+)$/i',$key,$reg))
|
|
||||||
{
|
{
|
||||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_civility','code','label');
|
$newstr=$this->getLabelFromKey($db,$reg[1],'c_civility','code','label');
|
||||||
}
|
}
|
||||||
else if (preg_match('/^OrderSource([0-9A-Z]+)$/i',$key,$reg))
|
elseif (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
|
||||||
|
{
|
||||||
|
$newstr=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','label');
|
||||||
|
}
|
||||||
|
elseif (preg_match('/^SendingMethod([0-9A-Z]+)$/i',$key,$reg))
|
||||||
|
{
|
||||||
|
$newstr=$this->getLabelFromKey($db,$reg[1],'c_shipment_mode','code','libelle');
|
||||||
|
}
|
||||||
|
elseif (preg_match('/^PaymentTypeShort([0-9A-Z]+)$/i',$key,$reg))
|
||||||
{
|
{
|
||||||
// TODO Add a table for OrderSourceX
|
$newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle');
|
||||||
|
}
|
||||||
|
elseif (preg_match('/^OppStatusShort([0-9A-Z]+)$/i',$key,$reg))
|
||||||
|
{
|
||||||
|
$newstr=$this->getLabelFromKey($db,$reg[1],'c_lead_status','code','label');
|
||||||
|
}
|
||||||
|
elseif (preg_match('/^OppStatus([0-9A-Z]+)$/i',$key,$reg))
|
||||||
|
{
|
||||||
|
$newstr=$this->getLabelFromKey($db,$reg[1],'c_lead_status','code','label');
|
||||||
|
}
|
||||||
|
elseif (preg_match('/^OrderSource([0-9A-Z]+)$/i',$key,$reg))
|
||||||
|
{
|
||||||
|
// TODO OrderSourceX must be replaced with content of table llx_c_input_reason or llx_c_input_method
|
||||||
//$newstr=$this->getLabelFromKey($db,$reg[1],'c_ordersource','code','label');
|
//$newstr=$this->getLabelFromKey($db,$reg[1],'c_ordersource','code','label');
|
||||||
}
|
}
|
||||||
return $newstr;
|
return $newstr;
|
||||||
|
|||||||
@ -4650,7 +4650,7 @@ function dol_osencode($str)
|
|||||||
* @param string $fieldkey Field for code
|
* @param string $fieldkey Field for code
|
||||||
* @param string $fieldid Field for id
|
* @param string $fieldid Field for id
|
||||||
* @return int <0 if KO, Id of code if OK
|
* @return int <0 if KO, Id of code if OK
|
||||||
* @see getLabelFromKey
|
* @see $langs->getLabelFromKey
|
||||||
*/
|
*/
|
||||||
function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
|
function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
|
||||||
{
|
{
|
||||||
@ -4665,7 +4665,7 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
|
|||||||
return $cache_codes[$tablename][$key]; // Found in cache
|
return $cache_codes[$tablename][$key]; // Found in cache
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT ".$fieldid." as id";
|
$sql = "SELECT ".$fieldid." as valuetoget";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
|
||||||
$sql.= " WHERE ".$fieldkey." = '".$key."'";
|
$sql.= " WHERE ".$fieldkey." = '".$key."'";
|
||||||
dol_syslog('dol_getIdFromCode', LOG_DEBUG);
|
dol_syslog('dol_getIdFromCode', LOG_DEBUG);
|
||||||
@ -4673,7 +4673,7 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj) $cache_codes[$tablename][$key]=$obj->id;
|
if ($obj) $cache_codes[$tablename][$key]=$obj->valuetoget;
|
||||||
else $cache_codes[$tablename][$key]='';
|
else $cache_codes[$tablename][$key]='';
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
return $cache_codes[$tablename][$key];
|
return $cache_codes[$tablename][$key];
|
||||||
|
|||||||
@ -891,17 +891,17 @@ function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0, $sta
|
|||||||
$project_year_filter=0;
|
$project_year_filter=0;
|
||||||
|
|
||||||
$title=$langs->trans("Project");
|
$title=$langs->trans("Project");
|
||||||
if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Project").' ('.$langs->trans($projectstatic->statuts[$statut]).')';
|
if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Project").' ('.$langs->trans($projectstatic->statuts_long[$statut]).')';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($title,"index.php","","","","",$sortfield,$sortorder);
|
print_liste_field_titre($title,"index.php","","","","",$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print_liste_field_titre($langs->trans("OpportunityStatus"),"","","","",'align="right"',$sortfield,$sortorder);
|
//if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print_liste_field_titre($langs->trans("OpportunityStatus"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
if (empty($conf->global->PROJECT_HIDE_TASKS)) print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, COUNT(t.rowid) as nb";
|
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, COUNT(t.rowid) as nb";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
if ($mytasks)
|
if ($mytasks)
|
||||||
{
|
{
|
||||||
@ -939,7 +939,7 @@ function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0, $sta
|
|||||||
$sql.= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($project_year_filter,1,false)).")";
|
$sql.= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($project_year_filter,1,false)).")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut";
|
$sql.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status";
|
||||||
$sql.= " ORDER BY p.title, p.ref";
|
$sql.= " ORDER BY p.title, p.ref";
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
@ -967,9 +967,15 @@ function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0, $sta
|
|||||||
$projectstatic->ref=$objp->ref;
|
$projectstatic->ref=$objp->ref;
|
||||||
print $projectstatic->getNomUrl(1);
|
print $projectstatic->getNomUrl(1);
|
||||||
print ' - '.dol_trunc($objp->title,24).'</td>';
|
print ' - '.dol_trunc($objp->title,24).'</td>';
|
||||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print '<td align="right">'.$objp->fk_opp_status.'</td>';
|
/*if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||||
|
{
|
||||||
|
print '<td align="right">';
|
||||||
|
$code = dol_getIdFromCode($db, $objp->opp_status, 'c_lead_status', 'rowid', 'code');
|
||||||
|
if ($code) print $langs->trans("OppStatus".$code);
|
||||||
|
print '</td>';
|
||||||
|
}*/
|
||||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) print '<td align="right">'.$objp->nb.'</td>';
|
if (empty($conf->global->PROJECT_HIDE_TASKS)) print '<td align="right">'.$objp->nb.'</td>';
|
||||||
$projectstatic->statut = $objp->fk_statut;
|
$projectstatic->statut = $objp->status;
|
||||||
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -27,6 +27,7 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||||
|
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
|
$langs->load("deliveries");
|
||||||
$langs->load('companies');
|
$langs->load('companies');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -143,22 +144,23 @@ if ($resql)
|
|||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" size="10" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
print '<input class="flat" type="text" size="10" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Date
|
// Date delivery planned
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
if ($conf->livraison_bon->enabled)
|
if ($conf->livraison_bon->enabled)
|
||||||
{
|
{
|
||||||
|
// Delivery order
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
|
print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
// Date received
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
}
|
}
|
||||||
|
// Status
|
||||||
|
print '<td></td>';
|
||||||
|
// Search
|
||||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" align="center">';
|
|
||||||
print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -170,8 +172,9 @@ if ($resql)
|
|||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
// Ref
|
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
|
// Ref
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$shipment->id=$objp->rowid;
|
$shipment->id=$objp->rowid;
|
||||||
$shipment->ref=$objp->ref;
|
$shipment->ref=$objp->ref;
|
||||||
@ -195,11 +198,6 @@ if ($resql)
|
|||||||
}*/
|
}*/
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Date real
|
|
||||||
print '<td align="center">';
|
|
||||||
print dol_print_date($db->jdate($objp->date_expedition),"day");
|
|
||||||
print '</td>'."\n";
|
|
||||||
|
|
||||||
if ($conf->livraison_bon->enabled)
|
if ($conf->livraison_bon->enabled)
|
||||||
{
|
{
|
||||||
$shipment->fetchObjectLinked($shipment->id,$shipment->element);
|
$shipment->fetchObjectLinked($shipment->id,$shipment->element);
|
||||||
@ -209,13 +207,16 @@ if ($resql)
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print !empty($receiving) ? $receiving->getNomUrl($db) : '';
|
print !empty($receiving) ? $receiving->getNomUrl($db) : '';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
// Date received
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($objp->date_reception),"day");
|
print dol_print_date($db->jdate($objp->date_reception),"day");
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td align="right">'.$expedition->LibStatut($objp->fk_statut,5).'</td>';
|
print '<td align="right">'.$expedition->LibStatut($objp->fk_statut,5).'</td>';
|
||||||
|
|
||||||
|
print '<td></td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -308,7 +308,9 @@ if ($resql)
|
|||||||
|
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
print '<td align="right" colspan="2">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||||
|
|
||||||
|
print '<td></td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -42,6 +42,7 @@ $search_supplier_code = GETPOST("search_supplier_code");
|
|||||||
$search_supplier_accounting = GETPOST("search_supplier_accounting");
|
$search_supplier_accounting = GETPOST("search_supplier_accounting");
|
||||||
$search_datec = GETPOST("search_datec");
|
$search_datec = GETPOST("search_datec");
|
||||||
$search_categ = GETPOST('search_categ','int');
|
$search_categ = GETPOST('search_categ','int');
|
||||||
|
$search_status = GETPOST("search_status",'int');
|
||||||
$catid = GETPOST("catid",'int');
|
$catid = GETPOST("catid",'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -73,9 +74,12 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_supplier_accounting="";
|
$search_supplier_accounting="";
|
||||||
$search_datec="";
|
$search_datec="";
|
||||||
$search_categ="";
|
$search_categ="";
|
||||||
|
$search_status='';
|
||||||
$catid="";
|
$catid="";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||||
|
|
||||||
$extrafields->fetch_name_optionals_label('thirdparty');
|
$extrafields->fetch_name_optionals_label('thirdparty');
|
||||||
|
|
||||||
|
|
||||||
@ -92,6 +96,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form=new Form($db);
|
||||||
$htmlother=new FormOther($db);
|
$htmlother=new FormOther($db);
|
||||||
$thirdpartystatic=new Societe($db);
|
$thirdpartystatic=new Societe($db);
|
||||||
|
|
||||||
@ -127,6 +132,7 @@ if ($search_town) $sql .= natural_search('s.town', $search_town);
|
|||||||
if ($search_supplier_code) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_supplier_code)."%'";
|
if ($search_supplier_code) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_supplier_code)."%'";
|
||||||
if ($search_supplier_accounting) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_supplier_accounting)."%'";
|
if ($search_supplier_accounting) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_supplier_accounting)."%'";
|
||||||
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
|
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
|
||||||
|
if ($search_status!='') $sql.= " AND s.status = ".$db->escape($search_status);
|
||||||
if ($catid > 0) $sql.= " AND cf.fk_categorie = ".$catid;
|
if ($catid > 0) $sql.= " AND cf.fk_categorie = ".$catid;
|
||||||
if ($catid == -2) $sql.= " AND cf.fk_categorie IS NULL";
|
if ($catid == -2) $sql.= " AND cf.fk_categorie IS NULL";
|
||||||
if ($search_categ > 0) $sql.= " AND cf.fk_categorie = ".$search_categ;
|
if ($search_categ > 0) $sql.= " AND cf.fk_categorie = ".$search_categ;
|
||||||
@ -156,6 +162,7 @@ if ($resql)
|
|||||||
|
|
||||||
$param = "&search_name=".$search_name."&search_supplier_code=".$search_supplier_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
$param = "&search_name=".$search_name."&search_supplier_code=".$search_supplier_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||||
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
||||||
|
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies');
|
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies');
|
||||||
|
|
||||||
@ -194,7 +201,8 @@ if ($resql)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre('');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -221,6 +229,10 @@ if ($resql)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
print '<td class="liste_titre" align="center">';
|
||||||
|
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
@ -253,7 +265,9 @@ if ($resql)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print '<td align="right">'.$thirdpartystatic->getLibStatut(3).'</td>';
|
print '<td align="center">'.$thirdpartystatic->getLibStatut(3).'</td>';
|
||||||
|
|
||||||
|
print '<td></td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
31
htdocs/install/mysql/data/llx_c_lead_status.sql
Normal file
31
htdocs/install/mysql/data/llx_c_lead_status.sql
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
-- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
--
|
||||||
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- 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/>.
|
||||||
|
--
|
||||||
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
|
||||||
|
-- de l'install et tous les sigles '--' sont supprimés.
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Opportunities status
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (1,'PROSP' ,'Prospection', 10, 0,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (2,'QUAL' ,'Qualification',20, 20,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (3,'PROPO' ,'Proposal', 30, 40,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (4,'NEGO' ,'Negotiation', 40, 60,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (5,'PENDING','Pending', 50, 50,0);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (6,'WON' ,'Won', 60, 100,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (7,'LOST' ,'Lost', 70, 0,1);
|
||||||
|
|
||||||
@ -706,12 +706,22 @@ UPDATE llx_holiday_logs SET fk_type = 1 WHERE fk_type IS NULL;
|
|||||||
|
|
||||||
UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_VAT_SOLD_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTING_VAT_ACCOUNT';
|
UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_VAT_SOLD_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTING_VAT_ACCOUNT';
|
||||||
|
|
||||||
-- Opportunities status
|
create table llx_c_lead_status
|
||||||
INSERT INTO llx_c_lead_status(rowid,code,label,percent,active) VALUES (1,'PROSP' ,'Prospection',0,1);
|
(
|
||||||
INSERT INTO llx_c_lead_status(rowid,code,label,percent,active) VALUES (2,'QUAL' ,'Qualification',20,1);
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
INSERT INTO llx_c_lead_status(rowid,code,label,percent,active) VALUES (3,'PROPO' ,'Proposal',40,1);
|
code varchar(10),
|
||||||
INSERT INTO llx_c_lead_status(rowid,code,label,percent,active) VALUES (4,'NEGO' ,'Negotiation',60,1);
|
label varchar(50),
|
||||||
INSERT INTO llx_c_lead_status(rowid,code,label,percent,active) VALUES (5,'PENDING','Pending',50,0);
|
position integer,
|
||||||
INSERT INTO llx_c_lead_status(rowid,code,label,percent,active) VALUES (6,'WIN' ,'Won',100,1);
|
percent double(5,2),
|
||||||
INSERT INTO llx_c_lead_status(rowid,code,label,percent,active) VALUES (7,'LOST' ,'Lost',0,1);
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
-- Opportunities status
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (1,'PROSP' ,'Prospection', 10, 0,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (2,'QUAL' ,'Qualification',20, 20,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (3,'PROPO' ,'Proposal', 30, 40,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (4,'NEGO' ,'Negotiation', 40, 60,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (5,'PENDING','Pending', 50, 50,0);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (6,'WIN' ,'Won', 60, 100,1);
|
||||||
|
INSERT INTO llx_c_lead_status(rowid,code,label,position,percent,active) VALUES (7,'LOST' ,'Lost', 70, 0,1);
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@ create table llx_c_lead_status
|
|||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
code varchar(10),
|
code varchar(10),
|
||||||
label varchar(50),
|
label varchar(50),
|
||||||
|
position integer,
|
||||||
percent double(5,2),
|
percent double(5,2),
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -821,6 +821,7 @@ DictionaryEMailTemplates=Emails templates
|
|||||||
DictionaryUnits=Units
|
DictionaryUnits=Units
|
||||||
DictionaryProspectStatus=Prospection status
|
DictionaryProspectStatus=Prospection status
|
||||||
DictionaryHolidayTypes=Type of leaves
|
DictionaryHolidayTypes=Type of leaves
|
||||||
|
DictionaryOpportunityStatus=Opportunity status for project/lead
|
||||||
SetupSaved=Setup saved
|
SetupSaved=Setup saved
|
||||||
BackToModuleList=Back to modules list
|
BackToModuleList=Back to modules list
|
||||||
BackToDictionaryList=Back to dictionaries list
|
BackToDictionaryList=Back to dictionaries list
|
||||||
|
|||||||
@ -122,7 +122,7 @@ TaskCreatedInDolibarr=Task %s created
|
|||||||
TaskModifiedInDolibarr=Task %s modified
|
TaskModifiedInDolibarr=Task %s modified
|
||||||
TaskDeletedInDolibarr=Task %s deleted
|
TaskDeletedInDolibarr=Task %s deleted
|
||||||
OpportunityStatus=Opportunity status
|
OpportunityStatus=Opportunity status
|
||||||
OpportunityAmount=Apportunity amount
|
OpportunityAmount=Opportunity amount
|
||||||
##### Types de contacts #####
|
##### Types de contacts #####
|
||||||
TypeContact_project_internal_PROJECTLEADER=Project leader
|
TypeContact_project_internal_PROJECTLEADER=Project leader
|
||||||
TypeContact_project_external_PROJECTLEADER=Project leader
|
TypeContact_project_external_PROJECTLEADER=Project leader
|
||||||
@ -156,3 +156,5 @@ ResourceNotAssignedToTask=Not assigned to task
|
|||||||
AssignTaskToMe=Assign task to me
|
AssignTaskToMe=Assign task to me
|
||||||
AssignTask=Assign
|
AssignTask=Assign
|
||||||
ProjectOverview=Overview
|
ProjectOverview=Overview
|
||||||
|
ManageTasks=Use projects to follow tasks and time
|
||||||
|
ManageOpportunitiesStatus=Use projects to follow leads/opportinuties
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -93,10 +93,11 @@ print '<table class="liste">'."\n";
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.id_sondage",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.id_sondage",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Title"), $_SERVER["PHP_SELF"], "p.titre",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Title"), $_SERVER["PHP_SELF"], "p.titre",$param,"","",$sortfield,$sortorder);
|
||||||
print '<td>'. $langs->trans("Type") .'</td>';
|
print_liste_field_titre($langs->trans("Type"));
|
||||||
print_liste_field_titre($langs->trans("Author"), $_SERVER["PHP_SELF"], "u.".$fieldtosortuser,$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Author"), $_SERVER["PHP_SELF"], "u.".$fieldtosortuser,$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("NbOfVoters"));
|
||||||
print_liste_field_titre($langs->trans("ExpireDate"), $_SERVER["PHP_SELF"], "p.date_fin",$param,"",'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("ExpireDate"), $_SERVER["PHP_SELF"], "p.date_fin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||||
print '<td align="center">'. $langs->trans("NbOfVoters") .'</td>';
|
print_liste_field_titre('');
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -104,6 +105,7 @@ print '<td></td>';
|
|||||||
print '<td><input type="text" name="surveytitle" value="'.dol_escape_htmltag($surveytitle).'"></td>';
|
print '<td><input type="text" name="surveytitle" value="'.dol_escape_htmltag($surveytitle).'"></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
$arraystatus=array(''=>' ','expired'=>$langs->trans("Expired"),'opened'=>$langs->trans("Opened"));
|
$arraystatus=array(''=>' ','expired'=>$langs->trans("Expired"),'opened'=>$langs->trans("Opened"));
|
||||||
print '<td align="center">'. $form->selectarray('status', $arraystatus, $status).'</td>';
|
print '<td align="center">'. $form->selectarray('status', $arraystatus, $status).'</td>';
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
@ -174,11 +176,13 @@ while ($i < min($num,$limit))
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
print'<td align="center">'.$nbuser.'</td>'."\n";
|
||||||
|
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_fin),'day');
|
print '<td align="center">'.dol_print_date($db->jdate($obj->date_fin),'day');
|
||||||
if ($db->jdate($obj->date_fin) < time()) { print ' ('.$langs->trans("Expired").')'; }
|
if ($db->jdate($obj->date_fin) < time()) { print ' ('.$langs->trans("Expired").')'; }
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print'<td align="center">'.$nbuser.'</td>'."\n";
|
print'<td align="center"></td>'."\n";
|
||||||
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -878,7 +878,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Description (used in invoice, propal...)
|
// Description (used in invoice, propal...)
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||||
|
|
||||||
$doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 80);
|
$doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 80);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
@ -886,7 +886,7 @@ else
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Public URL
|
// Public URL
|
||||||
print '<tr><td valign="top">'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
||||||
print '<input type="text" name="url" size="90" value="'.GETPOST('url').'">';
|
print '<input type="text" name="url" size="90" value="'.GETPOST('url').'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -972,7 +972,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note (private, no output on invoices, propales...)
|
// Note (private, no output on invoices, propales...)
|
||||||
print '<tr><td valign="top">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="3">';
|
print '<tr><td class="tdtop">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="3">';
|
||||||
|
|
||||||
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
||||||
$doleditor = new DolEditor('note', GETPOST('note'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, 70);
|
$doleditor = new DolEditor('note', GETPOST('note'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, 70);
|
||||||
@ -1164,7 +1164,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Description (used in invoice, propal...)
|
// Description (used in invoice, propal...)
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||||
|
|
||||||
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
||||||
$doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 80);
|
$doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 80);
|
||||||
@ -1174,7 +1174,7 @@ else
|
|||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
// Public Url
|
// Public Url
|
||||||
print '<tr><td valign="top">'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
||||||
print '<input type="text" name="url" size="80" value="'.$object->url.'">';
|
print '<input type="text" name="url" size="80" value="'.$object->url.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1266,7 +1266,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr><td valign="top">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="3">';
|
print '<tr><td class="tdtop">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="3">';
|
||||||
|
|
||||||
$doleditor = new DolEditor('note', $object->note, '', 140, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 80);
|
$doleditor = new DolEditor('note', $object->note, '', 140, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 80);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
@ -1275,7 +1275,7 @@ else
|
|||||||
|
|
||||||
if($conf->categorie->enabled) {
|
if($conf->categorie->enabled) {
|
||||||
// Categories
|
// Categories
|
||||||
print '<tr><td valign="top">'.$langs->trans("Categories").'</td><td colspan="3">';
|
print '<tr><td class="tdtop">'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
|
||||||
$c = new Categorie($db);
|
$c = new Categorie($db);
|
||||||
$cats = $c->containing($object->id,Categorie::TYPE_PRODUCT);
|
$cats = $c->containing($object->id,Categorie::TYPE_PRODUCT);
|
||||||
@ -1483,10 +1483,10 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="2">'.(dol_textishtml($object->description)?$object->description:dol_nl2br($object->description,1,true)).'</td></tr>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="2">'.(dol_textishtml($object->description)?$object->description:dol_nl2br($object->description,1,true)).'</td></tr>';
|
||||||
|
|
||||||
// Public URL
|
// Public URL
|
||||||
print '<tr><td valign="top">'.$langs->trans("PublicUrl").'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td colspan="2">';
|
||||||
print dol_print_url($object->url);
|
print dol_print_url($object->url);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1593,7 +1593,7 @@ else
|
|||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<!-- show Note --> '."\n";
|
print '<!-- show Note --> '."\n";
|
||||||
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="'.(2+(($showphoto||$showbarcode)?1:0)).'">'.(dol_textishtml($object->note)?$object->note:dol_nl2br($object->note,1,true)).'</td></tr>'."\n";
|
print '<tr><td class="tdtop">'.$langs->trans("Note").'</td><td colspan="'.(2+(($showphoto||$showbarcode)?1:0)).'">'.(dol_textishtml($object->note)?$object->note:dol_nl2br($object->note,1,true)).'</td></tr>'."\n";
|
||||||
print '<!-- End show Note --> '."\n";
|
print '<!-- End show Note --> '."\n";
|
||||||
|
|
||||||
// Categories
|
// Categories
|
||||||
|
|||||||
@ -489,7 +489,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
// Opportunity status
|
// Opportunity status
|
||||||
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td>';
|
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formproject->selectOpportunityStatus('fk_opp_status',$object->opp_status);
|
print $formproject->selectOpportunityStatus('opp_status',$object->opp_status);
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Opportunity amount
|
// Opportunity amount
|
||||||
@ -503,7 +503,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<textarea name="description" wrap="soft" cols="80" rows="'.ROWS_3.'">'.$_POST["description"].'</textarea>';
|
print '<textarea name="description" wrap="soft" cols="80" rows="'.ROWS_3.'">'.$_POST["description"].'</textarea>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -628,7 +628,7 @@ else
|
|||||||
print $form->selectarray('public',$array,$object->public);
|
print $form->selectarray('public',$array,$object->public);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Status
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
@ -646,7 +646,9 @@ else
|
|||||||
|
|
||||||
// Opportunity status
|
// Opportunity status
|
||||||
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td>';
|
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td>';
|
||||||
print '<td><input size="4" type="text" name="fk_opp_status" value="'.(isset($_POST['fk_opp_status'])?GETPOST('fk_opp_status'):$object->opp_status).'"></td>';
|
print '<td>';
|
||||||
|
print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1);
|
||||||
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Opportunity amount
|
// Opportunity amount
|
||||||
@ -720,12 +722,13 @@ else
|
|||||||
print dol_print_date($object->date_end,'day');
|
print dol_print_date($object->date_end,'day');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Budget
|
// Opportunity status
|
||||||
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
|
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
|
||||||
if ($object->fk_opp_status != '') print price($object->fk_opp_status,'',$langs,0,0,0,$conf->currency);
|
$code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');
|
||||||
|
if ($code) print $langs->trans("OppStatus".$code);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Opporutinity Amount
|
// Opportunity Amount
|
||||||
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
|
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
|
||||||
if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency);
|
if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -66,8 +66,8 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
var $statuts_short;
|
var $statuts_short;
|
||||||
var $statuts_long;
|
var $statuts_long;
|
||||||
var $statuts; // 0=draft, 1=opened, 2=closed
|
|
||||||
|
|
||||||
|
var $statut; // 0=draft, 1=opened, 2=closed
|
||||||
var $opp_status; // opportunity status, into table llx_c_lead_status
|
var $opp_status; // opportunity status, into table llx_c_lead_status
|
||||||
|
|
||||||
var $oldcopy;
|
var $oldcopy;
|
||||||
@ -157,7 +157,7 @@ class Project extends CommonObject
|
|||||||
$sql.= ", '" . $this->db->escape($this->description) . "'";
|
$sql.= ", '" . $this->db->escape($this->description) . "'";
|
||||||
$sql.= ", " . ($this->socid > 0 ? $this->socid : "null");
|
$sql.= ", " . ($this->socid > 0 ? $this->socid : "null");
|
||||||
$sql.= ", " . $user->id;
|
$sql.= ", " . $user->id;
|
||||||
$sql.= ", ".(is_numeric($this->statuts) ? $this->statuts : '0');
|
$sql.= ", ".(is_numeric($this->statut) ? $this->statut : '0');
|
||||||
$sql.= ", ".(is_numeric($this->opp_status) ? $this->opp_status : 'NULL');
|
$sql.= ", ".(is_numeric($this->opp_status) ? $this->opp_status : 'NULL');
|
||||||
$sql.= ", " . ($this->public ? 1 : 0);
|
$sql.= ", " . ($this->public ? 1 : 0);
|
||||||
$sql.= ", '".$this->db->idate($now)."'";
|
$sql.= ", '".$this->db->idate($now)."'";
|
||||||
@ -236,6 +236,7 @@ class Project extends CommonObject
|
|||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->title = trim($this->title);
|
$this->title = trim($this->title);
|
||||||
$this->description = trim($this->description);
|
$this->description = trim($this->description);
|
||||||
|
if ($this->opp_amount < 0) $this->opp_amount='';
|
||||||
|
|
||||||
if (dol_strlen(trim($this->ref)) > 0)
|
if (dol_strlen(trim($this->ref)) > 0)
|
||||||
{
|
{
|
||||||
@ -258,7 +259,7 @@ class Project extends CommonObject
|
|||||||
$sql.= ", budget_amount = " . (strcmp($this->budget_amount, '') ? price2num($this->budget_amount) : "null");
|
$sql.= ", budget_amount = " . (strcmp($this->budget_amount, '') ? price2num($this->budget_amount) : "null");
|
||||||
$sql.= " WHERE rowid = " . $this->id;
|
$sql.= " WHERE rowid = " . $this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::Update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -317,13 +318,13 @@ class Project extends CommonObject
|
|||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
$this->errors[] = $this->error;
|
$this->errors[] = $this->error;
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
dol_syslog(get_class($this)."::Update error -2 " . $this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::update error -2 " . $this->error, LOG_ERR);
|
||||||
$result = -2;
|
$result = -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::Update ref null");
|
dol_syslog(get_class($this)."::update ref null");
|
||||||
$result = -1;
|
$result = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2012-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -183,7 +183,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
else print $langs->trans('PrivateProject');
|
else print $langs->trans('PrivateProject');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Status
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
@ -196,6 +196,22 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print dol_print_date($object->date_end,'day');
|
print dol_print_date($object->date_end,'day');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Opportunity status
|
||||||
|
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
|
||||||
|
$code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');
|
||||||
|
if ($code) print $langs->trans("OppStatus".$code);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Opportunity Amount
|
||||||
|
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
|
||||||
|
if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Budget
|
||||||
|
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||||
|
if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -157,6 +157,22 @@ print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
|||||||
print dol_print_date($object->date_end,'day');
|
print dol_print_date($object->date_end,'day');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Opportunity status
|
||||||
|
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
|
||||||
|
$code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');
|
||||||
|
if ($code) print $langs->trans("OppStatus".$code);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Opportunity Amount
|
||||||
|
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
|
||||||
|
if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Budget
|
||||||
|
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||||
|
if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -490,13 +506,18 @@ foreach ($listofreferent as $key => $value)
|
|||||||
$element = new $classname($db);
|
$element = new $classname($db);
|
||||||
|
|
||||||
$addform='';
|
$addform='';
|
||||||
$selectList=$formproject->select_element($tablename,$object->thirdparty->id);
|
|
||||||
|
$idtofilterthirdparty=0;
|
||||||
|
if (! in_array($tablename, array('facture_fourn', 'commande_fourn'))) $idtofilterthirdparty=$object->thirdparty->id;
|
||||||
|
|
||||||
|
$selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth200');
|
||||||
if (! $selectList || ($selectList<0))
|
if (! $selectList || ($selectList<0))
|
||||||
{
|
{
|
||||||
setEventMessages($formproject->error,$formproject->errors,'errors');
|
setEventMessages($formproject->error,$formproject->errors,'errors');
|
||||||
}
|
}
|
||||||
elseif($selectList)
|
elseif($selectList)
|
||||||
{
|
{
|
||||||
|
// Define form with the combo list of elements to link
|
||||||
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
||||||
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
|
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||||
$addform.='<input type="hidden" name="action" value="addelement">';
|
$addform.='<input type="hidden" name="action" value="addelement">';
|
||||||
@ -806,6 +827,7 @@ foreach ($listofreferent as $key => $value)
|
|||||||
print $elementarray;
|
print $elementarray;
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -94,6 +94,7 @@ if (! empty($conf->projet->enabled) && $user->rights->projet->lire)
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of draft projects
|
||||||
print_projecttasks_array($db,$socid,$projectsListId,0,0);
|
print_projecttasks_array($db,$socid,$projectsListId,0,0);
|
||||||
|
|
||||||
|
|
||||||
@ -164,7 +165,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
|
|
||||||
$max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
|
$max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
|
||||||
|
|
||||||
$sql = "SELECT p.ref, p.title, p.rowid as projectid, t.label, t.rowid as taskid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee, SUM(tasktime.task_duration) as timespent";
|
$sql = "SELECT p.ref, p.title, p.rowid as projectid, p.fk_statut as status, p.fk_opp_status as opp_status, t.label, t.rowid as taskid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee, SUM(tasktime.task_duration) as timespent";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||||
@ -195,6 +196,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
//print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
|
//print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
|
||||||
print '<th>'.$langs->trans('Projects').'</th>';
|
print '<th>'.$langs->trans('Projects').'</th>';
|
||||||
|
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print '<th>'.$langs->trans('OpportunityStatus').'</th>';
|
||||||
print '<th>'.$langs->trans('Task').'</th>';
|
print '<th>'.$langs->trans('Task').'</th>';
|
||||||
print '<th>'.$langs->trans('DateStart').'</th>';
|
print '<th>'.$langs->trans('DateStart').'</th>';
|
||||||
print '<th>'.$langs->trans('DateEnd').'</th>';
|
print '<th>'.$langs->trans('DateEnd').'</th>';
|
||||||
@ -226,6 +228,13 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
print $projectstatic->getNomUrl(1,'',16);
|
print $projectstatic->getNomUrl(1,'',16);
|
||||||
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$obj->projectid.'">'.$obj->title.'</a>';
|
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$obj->projectid.'">'.$obj->title.'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$code = dol_getIdFromCode($db, $obj->opp_status, 'c_lead_status', 'rowid', 'code');
|
||||||
|
if ($code) print $langs->trans("OppStatus".$code);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (! empty($obj->taskid))
|
if (! empty($obj->taskid))
|
||||||
{
|
{
|
||||||
@ -264,7 +273,9 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
|||||||
|
|
||||||
if ($num > $max)
|
if ($num > $max)
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="6">'.$langs->trans("WarningTooManyDataPleaseUseMoreFilters").'</td></tr>';
|
$colspan=6;
|
||||||
|
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) $colspan++;
|
||||||
|
print '<tr><td colspan="'.$colspan.'">'.$langs->trans("WarningTooManyDataPleaseUseMoreFilters").'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|||||||
@ -30,6 +30,7 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
|
|
||||||
@ -68,6 +69,7 @@ $search_societe=GETPOST("search_societe");
|
|||||||
$search_year=GETPOST("search_year");
|
$search_year=GETPOST("search_year");
|
||||||
$search_all=GETPOST("search_all");
|
$search_all=GETPOST("search_all");
|
||||||
$search_status=GETPOST("search_status",'int');
|
$search_status=GETPOST("search_status",'int');
|
||||||
|
$search_opp_status=GETPOST("search_opp_status",'int');
|
||||||
$search_public=GETPOST("search_public",'int');
|
$search_public=GETPOST("search_public",'int');
|
||||||
$search_user=GETPOST('search_user','int');
|
$search_user=GETPOST('search_user','int');
|
||||||
$search_sale=GETPOST('search_sale','int');
|
$search_sale=GETPOST('search_sale','int');
|
||||||
@ -90,6 +92,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_societe="";
|
$search_societe="";
|
||||||
$search_year="";
|
$search_year="";
|
||||||
$search_status=-1;
|
$search_status=-1;
|
||||||
|
$search_opp_status=-1;
|
||||||
$search_public="";
|
$search_public="";
|
||||||
$search_sale="";
|
$search_sale="";
|
||||||
$search_user='';
|
$search_user='';
|
||||||
@ -115,15 +118,17 @@ $projectstatic = new Project($db);
|
|||||||
$socstatic = new Societe($db);
|
$socstatic = new Societe($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
|
$formproject = new FormProjets($db);
|
||||||
|
|
||||||
llxHeader("",$langs->trans("Projects"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
|
llxHeader("",$langs->trans("Projects"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
|
||||||
|
|
||||||
|
|
||||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:($user->rights->projet->all->lire?2:0)),1,$socid);
|
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:($user->rights->projet->all->lire?2:0)),1,$socid);
|
||||||
|
|
||||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_statut, p.public, p.fk_user_creat";
|
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_statut, p.fk_opp_status, p.public, p.fk_user_creat";
|
||||||
$sql.= ", p.datec as date_create, p.dateo as date_start, p.datee as date_end";
|
$sql.= ", p.datec as date_create, p.dateo as date_start, p.datee as date_end";
|
||||||
$sql.= ", s.nom as name, s.rowid as socid";
|
$sql.= ", s.nom as name, s.rowid as socid";
|
||||||
|
$sql.= ", cls.code as opp_status_code";
|
||||||
// Add fields for extrafields
|
// Add fields for extrafields
|
||||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@ -132,6 +137,7 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // N
|
|||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
|
||||||
|
|
||||||
// We'll need this table joined to the select in order to filter by sale
|
// We'll need this table joined to the select in order to filter by sale
|
||||||
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -177,6 +183,7 @@ else if ($year > 0)
|
|||||||
}
|
}
|
||||||
if ($search_all) $sql .= natural_search(array('p.ref','p.title','s.nom'), $search_all);
|
if ($search_all) $sql .= natural_search(array('p.ref','p.title','s.nom'), $search_all);
|
||||||
if ($search_status >= 0) $sql .= " AND p.fk_statut = ".$db->escape($search_status);
|
if ($search_status >= 0) $sql .= " AND p.fk_statut = ".$db->escape($search_status);
|
||||||
|
if ($search_opp_status > 0) $sql .= " AND p.fk_opp_status = ".$db->escape($search_opp_status);
|
||||||
if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);
|
if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);
|
||||||
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
||||||
if ($search_user > 0) $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user;
|
if ($search_user > 0) $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user;
|
||||||
@ -205,6 +212,7 @@ if ($resql)
|
|||||||
if ($search_label != '') $param.='&search_label='.$search_label;
|
if ($search_label != '') $param.='&search_label='.$search_label;
|
||||||
if ($search_societe != '') $param.='&search_societe='.$search_societe;
|
if ($search_societe != '') $param.='&search_societe='.$search_societe;
|
||||||
if ($search_status >= 0) $param.='&search_status='.$search_status;
|
if ($search_status >= 0) $param.='&search_status='.$search_status;
|
||||||
|
if ($search_opp_status >= 0) $param.='&search_opp_status='.$search_opp_status;
|
||||||
if ($search_public != '') $param.='&search_public='.$search_public;
|
if ($search_public != '') $param.='&search_public='.$search_public;
|
||||||
if ($search_user > 0) $param.='&search_user='.$search_user;
|
if ($search_user > 0) $param.='&search_user='.$search_user;
|
||||||
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
||||||
@ -271,6 +279,7 @@ if ($resql)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print_liste_field_titre($langs->trans("OpportunityStatus"),$_SERVER["PHP_SELF"],'p.fk_opp_statut',"",$param,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -312,6 +321,13 @@ if ($resql)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre nowrap">';
|
||||||
|
print $formproject->selectOpportunityStatus('search_opp_status',$search_opp_status,1,1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<td class="liste_titre nowrap" align="right">';
|
print '<td class="liste_titre nowrap" align="right">';
|
||||||
print $form->selectarray('search_status', array('-1'=>'', '0'=>$langs->trans('Draft'),'1'=>$langs->trans('Opened'),'2'=>$langs->trans('Closed')),$search_status);
|
print $form->selectarray('search_status', array('-1'=>'', '0'=>$langs->trans('Draft'),'1'=>$langs->trans('Opened'),'2'=>$langs->trans('Closed')),$search_status);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -418,9 +434,18 @@ if ($resql)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
if ($objp->opp_status_code) print $langs->trans("OppStatusShort".$objp->opp_status_code);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
$projectstatic->statut = $objp->fk_statut;
|
$projectstatic->statut = $objp->fk_statut;
|
||||||
print '<td align="right" colspan="2">'.$projectstatic->getLibStatut(5).'</td>';
|
print '<td align="right">'.$projectstatic->getLibStatut(5).'</td>';
|
||||||
|
|
||||||
|
print '<td></td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|||||||
@ -437,7 +437,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="9">'.$langs->trans("NoTasks").'</td></tr>';
|
print '<tr '.$bc[false].'><td colspan="9">'.$langs->trans("NoTasks").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|||||||
@ -1891,7 +1891,7 @@ div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border
|
|||||||
}
|
}
|
||||||
div .tdtop {
|
div .tdtop {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
padding-top: 5px;
|
padding-top: 5px !important;
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user