Merge pull request #800 from FHenry/develop
Qual : Review code after intalling PHPUnit, CodeSniffer on Eclipse...
This commit is contained in:
commit
a3c5db968e
@ -44,24 +44,24 @@ $object = new Expedition($db);
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
//if ($action==setvalue AND $carrier)
|
//if ($action==setvalue AND $carrier)
|
||||||
if ($action==setvalue)
|
if ($action=='setvalue')
|
||||||
{
|
{
|
||||||
// need to add check on values
|
// need to add check on values
|
||||||
$object->update[code]=GETPOST('code','alpha');
|
$object->update['code']=GETPOST('code','alpha');
|
||||||
$object->update[libelle]=GETPOST('libelle','alpha');
|
$object->update['libelle']=GETPOST('libelle','alpha');
|
||||||
$object->update[description]=GETPOST('description','alpha');
|
$object->update['description']=GETPOST('description','alpha');
|
||||||
$object->update[tracking]=GETPOST('tracking','alpha');
|
$object->update['tracking']=GETPOST('tracking','alpha');
|
||||||
$object->update_delivery_method($carrier);
|
$object->update_delivery_method($carrier);
|
||||||
header("Location: carrier.php");
|
header("Location: carrier.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action==activate_carrier AND $carrier!='')
|
if ($action=='activate_carrier' && $carrier!='')
|
||||||
{
|
{
|
||||||
$object->activ_delivery_method($carrier);
|
$object->activ_delivery_method($carrier);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action==disable_carrier AND $carrier!='')
|
if ($action=='disable_carrier' && $carrier!='')
|
||||||
{
|
{
|
||||||
$object->disable_delivery_method($carrier);
|
$object->disable_delivery_method($carrier);
|
||||||
}
|
}
|
||||||
@ -134,26 +134,26 @@ if ($action=='edit_carrier' || $action=='setvalue')
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||||
print $langs->trans("Code").'</td><td>';
|
print $langs->trans("Code").'</td><td>';
|
||||||
print '<input size="32" type="text" name="code" value="'.$object->listmeths[0][code].'">';
|
print '<input size="32" type="text" name="code" value="'.$object->listmeths[0]['code'].'">';
|
||||||
print ' '.$langs->trans("Example").': CODE';
|
print ' '.$langs->trans("Example").': CODE';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||||
print $langs->trans("Name").'</td><td>';
|
print $langs->trans("Name").'</td><td>';
|
||||||
print '<input size="32" type="text" name="libelle" value="'.$object->listmeths[0][libelle].'">';
|
print '<input size="32" type="text" name="libelle" value="'.$object->listmeths[0]['libelle'].'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||||
print $langs->trans("Description").'</td><td>';
|
print $langs->trans("Description").'</td><td>';
|
||||||
print '<input size="64" type="text" name="description" value="'.$object->listmeths[0][description].'">';
|
print '<input size="64" type="text" name="description" value="'.$object->listmeths[0]['description'].'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||||
print $langs->trans("Tracking").'</td><td>';
|
print $langs->trans("Tracking").'</td><td>';
|
||||||
print '<input size="128" type="text" name="tracking" value="'.$object->listmeths[0][tracking].'">';
|
print '<input size="128" type="text" name="tracking" value="'.$object->listmeths[0]['tracking'].'">';
|
||||||
print ' '.$langs->trans("Example").': http://www.website.com/dir/{TRACKID}';
|
print ' '.$langs->trans("Example").': http://www.website.com/dir/{TRACKID}';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -186,25 +186,26 @@ else
|
|||||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||||
print '<td align="center" width="30">'.$langs->trans("Edit").'</td>';
|
print '<td align="center" width="30">'.$langs->trans("Edit").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
for ($i=0; $i<sizeof($object->listmeths); $i++)
|
$numlistmeths=count($object->listmeths);
|
||||||
|
for ($i=0; $i<$numlistmeths; $i++)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td>'.$object->listmeths[$i][code].'</td>';
|
print '<td>'.$object->listmeths[$i]['code'].'</td>';
|
||||||
print '<td>'.$object->listmeths[$i][libelle].'</td>';
|
print '<td>'.$object->listmeths[$i]['libelle'].'</td>';
|
||||||
print '<td>'.$object->listmeths[$i][description].'</td>';
|
print '<td>'.$object->listmeths[$i]['description'].'</td>';
|
||||||
print '<td>'.$object->listmeths[$i][tracking].'</td>';
|
print '<td>'.$object->listmeths[$i]['tracking'].'</td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if($object->listmeths[$i][active] == 0)
|
if($object->listmeths[$i]['active'] == 0)
|
||||||
{
|
{
|
||||||
print '<a href="carrier.php?action=activate_carrier&carrier='.$object->listmeths[$i][rowid].'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="carrier.php?action=activate_carrier&carrier='.$object->listmeths[$i]['rowid'].'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="carrier.php?action=disable_carrier&carrier='.$object->listmeths[$i][rowid].'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
print '<a href="carrier.php?action=disable_carrier&carrier='.$object->listmeths[$i]['rowid'].'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||||
}
|
}
|
||||||
print '</td><td align="center">';
|
print '</td><td align="center">';
|
||||||
print '<a href="carrier.php?action=edit_carrier&carrier='.$object->listmeths[$i][rowid].'">'.img_picto($langs->trans("Edit"),'edit').'</a>';
|
print '<a href="carrier.php?action=edit_carrier&carrier='.$object->listmeths[$i]['rowid'].'">'.img_picto($langs->trans("Edit"),'edit').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1199,7 +1199,6 @@ class Propal extends CommonObject
|
|||||||
* Update value of extrafields on the proposal
|
* Update value of extrafields on the proposal
|
||||||
*
|
*
|
||||||
* @param User $user Object user that modify
|
* @param User $user Object user that modify
|
||||||
* @param double $remise Amount discount
|
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
function update_extrafields($user)
|
function update_extrafields($user)
|
||||||
|
|||||||
@ -1107,7 +1107,7 @@ else if ($action == 'print_file' AND $user->rights->printipp->use)
|
|||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php';
|
||||||
$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
|
$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
|
||||||
$printer->print_file(GETPOST('file',alpha),GETPOST('printer',alpha));
|
$printer->print_file(GETPOST('file','alpha'),GETPOST('printer','alpha'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -559,7 +559,6 @@ class Facture extends CommonInvoice
|
|||||||
* Load an object from its id and create a new one in database
|
* Load an object from its id and create a new one in database
|
||||||
*
|
*
|
||||||
* @param int $socid Id of thirdparty
|
* @param int $socid Id of thirdparty
|
||||||
* @param HookManager $hookmanager Hook manager instance
|
|
||||||
* @return int New id of clone
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
function createFromClone($socid=0)
|
function createFromClone($socid=0)
|
||||||
|
|||||||
@ -894,6 +894,8 @@ class Contrat extends CommonObject
|
|||||||
* @param float $price_base_type HT or TTC
|
* @param float $price_base_type HT or TTC
|
||||||
* @param float $pu_ttc Prix unitaire TTC
|
* @param float $pu_ttc Prix unitaire TTC
|
||||||
* @param int $info_bits Bits de type de lignes
|
* @param int $info_bits Bits de type de lignes
|
||||||
|
* @param int $fk_fournprice Fourn price id
|
||||||
|
* @param int $pa_ht Buying price HT
|
||||||
* @return int <0 si erreur, >0 si ok
|
* @return int <0 si erreur, >0 si ok
|
||||||
*/
|
*/
|
||||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
|
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
|
||||||
@ -1034,6 +1036,8 @@ class Contrat extends CommonObject
|
|||||||
* @param timestamp $date_fin_reel Date de fin reelle
|
* @param timestamp $date_fin_reel Date de fin reelle
|
||||||
* @param float $price_base_type HT or TTC
|
* @param float $price_base_type HT or TTC
|
||||||
* @param int $info_bits Bits de type de lignes
|
* @param int $info_bits Bits de type de lignes
|
||||||
|
* @param int $fk_fournprice Fourn price id
|
||||||
|
* @param int $pa_ht Buying price HT
|
||||||
* @return int < 0 si erreur, > 0 si ok
|
* @return int < 0 si erreur, > 0 si ok
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
|
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
|
||||||
|
|||||||
@ -46,6 +46,8 @@ class box_comptes extends ModeleBoxes
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,6 +46,8 @@ class box_members extends ModeleBoxes
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2196,7 +2196,7 @@ abstract class CommonObject
|
|||||||
* @param object $extrafields extrafield Object
|
* @param object $extrafields extrafield Object
|
||||||
* @param string $mode Show output (view) or input (edit) for extrafield
|
* @param string $mode Show output (view) or input (edit) for extrafield
|
||||||
*
|
*
|
||||||
* return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showOptionals($extrafields,$mode='view')
|
function showOptionals($extrafields,$mode='view')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,6 +42,9 @@ class dolprintIPP
|
|||||||
* @param DoliDB $db database
|
* @param DoliDB $db database
|
||||||
* @param string $host host of Cups
|
* @param string $host host of Cups
|
||||||
* @param string $port port
|
* @param string $port port
|
||||||
|
* @param string $userid userid
|
||||||
|
* @param string $user user
|
||||||
|
* @param string $password password
|
||||||
* @return printIPP
|
* @return printIPP
|
||||||
*/
|
*/
|
||||||
function __construct($db,$host,$port,$userid,$user,$password)
|
function __construct($db,$host,$port,$userid,$user,$password)
|
||||||
@ -77,6 +80,10 @@ class dolprintIPP
|
|||||||
/**
|
/**
|
||||||
* Print selected file
|
* Print selected file
|
||||||
*
|
*
|
||||||
|
* @param string $file file
|
||||||
|
* @param string $module module
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function print_file($file,$module)
|
function print_file($file,$module)
|
||||||
{
|
{
|
||||||
@ -112,6 +119,9 @@ class dolprintIPP
|
|||||||
/**
|
/**
|
||||||
* List jobs print
|
* List jobs print
|
||||||
*
|
*
|
||||||
|
* @param string $module module
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function list_jobs($module)
|
function list_jobs($module)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -97,6 +97,7 @@ class ExtraFields
|
|||||||
* @param string $elementtype Element type ('member', 'product', 'company', ...)
|
* @param string $elementtype Element type ('member', 'product', 'company', ...)
|
||||||
* @param int $unique Is field unique or not
|
* @param int $unique Is field unique or not
|
||||||
* @param int $required Is field required or not
|
* @param int $required Is field required or not
|
||||||
|
* @param string $default_value Defaulted value
|
||||||
* @param array $param Params for field
|
* @param array $param Params for field
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
@ -219,7 +220,7 @@ class ExtraFields
|
|||||||
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0,$param)
|
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -356,7 +357,7 @@ class ExtraFields
|
|||||||
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
||||||
* @return int >0 if OK, <=0 if KO
|
* @return int >0 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos,$param='')
|
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='')
|
||||||
{
|
{
|
||||||
$table=$elementtype.'_extrafields';
|
$table=$elementtype.'_extrafields';
|
||||||
// Special case for not normalized table names
|
// Special case for not normalized table names
|
||||||
@ -814,7 +815,7 @@ class ExtraFields
|
|||||||
* Fill array_options array for object by extrafields value (using for data send by forms)
|
* Fill array_options array for object by extrafields value (using for data send by forms)
|
||||||
*
|
*
|
||||||
* @param array $extralabels $array of extrafields
|
* @param array $extralabels $array of extrafields
|
||||||
* @param object $object object
|
* @param object &$object object
|
||||||
* @return int 1 if array_options set / 0 if no value
|
* @return int 1 if array_options set / 0 if no value
|
||||||
*/
|
*/
|
||||||
function setOptionalsFromPost($extralabels,&$object)
|
function setOptionalsFromPost($extralabels,&$object)
|
||||||
|
|||||||
@ -213,6 +213,7 @@ class FormOther
|
|||||||
*
|
*
|
||||||
* @param string $selected Value of preselected revenue stamp
|
* @param string $selected Value of preselected revenue stamp
|
||||||
* @param string $htmlname Name of combo list
|
* @param string $htmlname Name of combo list
|
||||||
|
* @param string $country_code Country Code
|
||||||
* @return string HTML select list
|
* @return string HTML select list
|
||||||
*/
|
*/
|
||||||
function select_revenue_stamp($selected='',$htmlname='revenuestamp',$country_code='')
|
function select_revenue_stamp($selected='',$htmlname='revenuestamp',$country_code='')
|
||||||
|
|||||||
@ -694,6 +694,7 @@ class Translate
|
|||||||
/**
|
/**
|
||||||
* Return a currency code into its symbol
|
* Return a currency code into its symbol
|
||||||
*
|
*
|
||||||
|
* @param string $currency_code Currency Code
|
||||||
* @param string $amount If not '', show currency + amount according to langs ($10, 10€).
|
* @param string $amount If not '', show currency + amount according to langs ($10, 10€).
|
||||||
* @return string Amount + Currency symbol encoded into UTF8
|
* @return string Amount + Currency symbol encoded into UTF8
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -301,6 +301,7 @@ function ajax_dialog($title,$message,$w=350,$h=150)
|
|||||||
*
|
*
|
||||||
* @param string $htmlname Name of html select field
|
* @param string $htmlname Name of html select field
|
||||||
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||||
|
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
|
||||||
* @return string Return html string to convert a select field into a combo
|
* @return string Return html string to convert a select field into a combo
|
||||||
*/
|
*/
|
||||||
function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0)
|
function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0)
|
||||||
|
|||||||
@ -1024,7 +1024,6 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
|||||||
* @param int $i Current line number
|
* @param int $i Current line number
|
||||||
* @param Translate $outputlangs Object langs for output
|
* @param Translate $outputlangs Object langs for output
|
||||||
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||||
* @param HookManager $hookmanager Hook manager instance
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
|
function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class MenuManager
|
|||||||
if ($leftmenu=="modulesadmintools" && $user->admin)
|
if ($leftmenu=="modulesadmintools" && $user->admin)
|
||||||
{
|
{
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
array_unshift($tabMenu,array(
|
$array_menu_product=array(
|
||||||
'url'=>"/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools",
|
'url'=>"/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools",
|
||||||
'titre'=>$langs->trans("ProductVatMassChange"),
|
'titre'=>$langs->trans("ProductVatMassChange"),
|
||||||
'enabled'=>($user->admin?true:false),
|
'enabled'=>($user->admin?true:false),
|
||||||
@ -130,10 +130,11 @@ class MenuManager
|
|||||||
'leftmenu'=>'modulesadmintools_massvat',
|
'leftmenu'=>'modulesadmintools_massvat',
|
||||||
'type'=>'left',
|
'type'=>'left',
|
||||||
'position'=>20
|
'position'=>20
|
||||||
));
|
);
|
||||||
|
array_unshift($tabMenu,$array_menu_product);
|
||||||
//$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);
|
//$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);
|
||||||
}
|
}
|
||||||
array_unshift($tabMenu,array(
|
$array_menu_product=array(
|
||||||
'url'=>"/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools",
|
'url'=>"/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools",
|
||||||
'titre'=>$langs->trans("ModulesSystemTools"),
|
'titre'=>$langs->trans("ModulesSystemTools"),
|
||||||
'enabled'=>($user->admin?true:false),
|
'enabled'=>($user->admin?true:false),
|
||||||
@ -144,7 +145,8 @@ class MenuManager
|
|||||||
'leftmenu'=>'modulesadmintools',
|
'leftmenu'=>'modulesadmintools',
|
||||||
'type'=>'left',
|
'type'=>'left',
|
||||||
'position'=>20
|
'position'=>20
|
||||||
));
|
);
|
||||||
|
array_unshift($tabMenu,$array_menu_product);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,9 +35,11 @@ include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
|
|||||||
class modPrintIPP extends DolibarrModules
|
class modPrintIPP extends DolibarrModules
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur. Definit les noms, constantes et boites
|
* Constructor
|
||||||
* \param DB handler d'acces base
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
@ -120,25 +122,33 @@ class modPrintIPP extends DolibarrModules
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module.
|
* Function called when module is enabled.
|
||||||
* Definit egalement les repertoires de donnees a creer pour ce module.
|
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
|
||||||
|
* It also creates data directories
|
||||||
|
*
|
||||||
|
* @param string $options Options when enabling module ('', 'noboxes')
|
||||||
|
* @return int 1 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
function init()
|
function init($options='')
|
||||||
{
|
|
||||||
$sql = array("CREATE TABLE IF NOT EXISTS llx_printer_ipp (rowid int(11) NOT NULL AUTO_INCREMENT,printer_name text NOT NULL, printer_location text NOT NULL,printer_uri varchar(256) NOT NULL,copy int(11) NOT NULL DEFAULT '1',module varchar(16) NOT NULL,login varchar(32) NOT NULL,PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
|
|
||||||
|
|
||||||
return $this->_init($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Fonction appelee lors de la desactivation d'un module.
|
|
||||||
* Supprime de la base les constantes, boites et permissions du module.
|
|
||||||
*/
|
|
||||||
function remove()
|
|
||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
return $this->_remove($sql);
|
return $this->_init($sql, $options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function called when module is disabled.
|
||||||
|
* Remove from database constants, boxes and permissions from Dolibarr database.
|
||||||
|
* Data directories are not deleted
|
||||||
|
*
|
||||||
|
* @param string $options Options when enabling module ('', 'noboxes')
|
||||||
|
* @return int 1 if OK, 0 if KO
|
||||||
|
*/
|
||||||
|
function remove($options='')
|
||||||
|
{
|
||||||
|
$sql = array();
|
||||||
|
|
||||||
|
return $this->_remove($sql, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1061,7 +1061,8 @@ class Cronjob extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Crob Job line class
|
* Crob Job line class
|
||||||
*/
|
*/
|
||||||
class Cronjobline{
|
class Cronjobline
|
||||||
|
{
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
var $ref;
|
var $ref;
|
||||||
|
|||||||
@ -1195,14 +1195,14 @@ class Expedition extends CommonObject
|
|||||||
{
|
{
|
||||||
while ($obj = $this->db->fetch_object($resql))
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$this->listmeths[$i][rowid] = $obj->rowid;
|
$this->listmeths[$i]['rowid'] = $obj->rowid;
|
||||||
$this->listmeths[$i][code] = $obj->code;
|
$this->listmeths[$i]['code'] = $obj->code;
|
||||||
$label=$langs->trans('SendingMethod'.$obj->code);
|
$label=$langs->trans('SendingMethod'.$obj->code);
|
||||||
$this->listmeths[$i][libelle] = ($label != 'SendingMethod'.$obj->code?$label:$obj->libelle);
|
$this->listmeths[$i]['libelle'] = ($label != 'SendingMethod'.$obj->code?$label:$obj->libelle);
|
||||||
$this->listmeths[$i][description] = $obj->description;
|
$this->listmeths[$i]['description'] = $obj->description;
|
||||||
if ($obj->tracking)
|
if ($obj->tracking)
|
||||||
{
|
{
|
||||||
$this->listmeths[$i][tracking] = $obj->tracking;
|
$this->listmeths[$i]['tracking'] = $obj->tracking;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1214,11 +1214,11 @@ class Expedition extends CommonObject
|
|||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($obj->code).'.modules.php';
|
require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($obj->code).'.modules.php';
|
||||||
$shipmethod = new $classname();
|
$shipmethod = new $classname();
|
||||||
$this->listmeths[$i][tracking] = $shipmethod->provider_url_status('{TRACKID}');
|
$this->listmeths[$i]['tracking'] = $shipmethod->provider_url_status('{TRACKID}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->listmeths[$i][active] = $obj->active;
|
$this->listmeths[$i]['active'] = $obj->active;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1227,7 +1227,9 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update/create delivery method.
|
* Update/create delivery method.
|
||||||
* @param id $id id method to activate
|
*
|
||||||
|
* @param string $id id method to activate
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function update_delivery_method($id='')
|
function update_delivery_method($id='')
|
||||||
@ -1235,16 +1237,16 @@ class Expedition extends CommonObject
|
|||||||
if ($id=='')
|
if ($id=='')
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)";
|
||||||
$sql.=" VALUES ('".$this->update[code]."','".$this->update[libelle]."','".$this->update[description]."','".$this->update[tracking]."')";
|
$sql.=" VALUES ('".$this->update['code']."','".$this->update['libelle']."','".$this->update['description']."','".$this->update['tracking']."')";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET";
|
||||||
$sql.= " code='".$this->update[code]."'";
|
$sql.= " code='".$this->update['code']."'";
|
||||||
$sql.= ",libelle='".$this->update[libelle]."'";
|
$sql.= ",libelle='".$this->update['libelle']."'";
|
||||||
$sql.= ",description='".$this->update[description]."'";
|
$sql.= ",description='".$this->update['description']."'";
|
||||||
$sql.= ",tracking='".$this->update[tracking]."'";
|
$sql.= ",tracking='".$this->update['tracking']."'";
|
||||||
$sql.= " WHERE rowid=".$id;
|
$sql.= " WHERE rowid=".$id;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
}
|
}
|
||||||
@ -1253,7 +1255,9 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate delivery method.
|
* Activate delivery method.
|
||||||
|
*
|
||||||
* @param id $id id method to activate
|
* @param id $id id method to activate
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function activ_delivery_method($id)
|
function activ_delivery_method($id)
|
||||||
@ -1267,7 +1271,9 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* DesActivate delivery method.
|
* DesActivate delivery method.
|
||||||
|
*
|
||||||
* @param id $id id method to desactivate
|
* @param id $id id method to desactivate
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function disable_delivery_method($id)
|
function disable_delivery_method($id)
|
||||||
|
|||||||
@ -210,4 +210,17 @@ ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0;
|
|||||||
ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0;
|
ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0;
|
||||||
ALTER TABLE llx_product_price ADD COLUMN import_key varchar(14) AFTER price_by_qty;
|
ALTER TABLE llx_product_price ADD COLUMN import_key varchar(14) AFTER price_by_qty;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE llx_printer_ipp
|
||||||
|
(
|
||||||
|
rowid int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
printer_name text NOT NULL,
|
||||||
|
printer_location text NOT NULL,
|
||||||
|
printer_uri varchar(256) NOT NULL,
|
||||||
|
copy int(11) NOT NULL DEFAULT '1',
|
||||||
|
module varchar(16) NOT NULL,
|
||||||
|
login varchar(32) NOT NULL,
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity;
|
ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity;
|
||||||
|
|
||||||
|
|||||||
28
htdocs/install/mysql/tables/llx_printer_ipp.sql
Normal file
28
htdocs/install/mysql/tables/llx_printer_ipp.sql
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
-- ============================================================================
|
||||||
|
-- Copyright (C) 2013 Florian HENRY <florian.henry@open-concept.pro>
|
||||||
|
--
|
||||||
|
-- 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/>.
|
||||||
|
--
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
CREATE TABLE llx_printer_ipp
|
||||||
|
(
|
||||||
|
rowid int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
printer_name text NOT NULL,
|
||||||
|
printer_location text NOT NULL,
|
||||||
|
printer_uri varchar(256) NOT NULL,
|
||||||
|
copy int(11) NOT NULL DEFAULT '1',
|
||||||
|
module varchar(16) NOT NULL,
|
||||||
|
login varchar(32) NOT NULL,
|
||||||
|
)ENGINE=innodb;
|
||||||
@ -2091,10 +2091,14 @@ class User extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update user using data from the LDAP
|
* Update user using data from the LDAP
|
||||||
* // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?)
|
*
|
||||||
|
* @param ldapuser &$ldapuser Ladp User
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update_ldap2dolibarr(&$ldapuser)
|
function update_ldap2dolibarr(&$ldapuser)
|
||||||
{
|
{
|
||||||
|
// TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?)
|
||||||
global $user, $conf;
|
global $user, $conf;
|
||||||
|
|
||||||
$this->firstname=$ldapuser->{$conf->global->LDAP_FIELD_FIRSTNAME};
|
$this->firstname=$ldapuser->{$conf->global->LDAP_FIELD_FIRSTNAME};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user